mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 01:39:37 +02:00
Improve NSFW system
* Add NSFW flags to videos so the publisher can add more NSFW context * Add NSFW summary to videos, similar to content warning system so the publisher has a free text to describe NSFW aspect of its video * Add additional "warn" NSFW policy: the video thumbnail is not blurred and we display a tag below the video miniature, the video player includes the NSFW warning (with context if available) and it also prevent autoplay * "blur" NSFW settings inherits "warn" policy and also blur the video thumbnail * Add NSFW flag settings to users so they can have more granular control about what content they want to hide, warn or display
This commit is contained in:
parent
fac6b15ada
commit
dd4027a10f
181 changed files with 5081 additions and 2061 deletions
|
@ -18,6 +18,7 @@ import {
|
|||
AuthHTTP,
|
||||
LiveManager,
|
||||
PeerTubePlugin,
|
||||
PeerTubeTheme,
|
||||
PlayerOptionsBuilder,
|
||||
PlaylistFetcher,
|
||||
PlaylistTracker,
|
||||
|
@ -41,6 +42,7 @@ export class PeerTubeEmbed {
|
|||
private readonly videoFetcher: VideoFetcher
|
||||
private readonly playlistFetcher: PlaylistFetcher
|
||||
private readonly peertubePlugin: PeerTubePlugin
|
||||
private readonly peertubeTheme: PeerTubeTheme
|
||||
private readonly playerHTML: PlayerHTML
|
||||
private readonly playerOptionsBuilder: PlayerOptionsBuilder
|
||||
private readonly liveManager: LiveManager
|
||||
|
@ -65,6 +67,7 @@ export class PeerTubeEmbed {
|
|||
this.videoFetcher = new VideoFetcher(this.http)
|
||||
this.playlistFetcher = new PlaylistFetcher(this.http)
|
||||
this.peertubePlugin = new PeerTubePlugin(this.http)
|
||||
this.peertubeTheme = new PeerTubeTheme(this.peertubePlugin)
|
||||
this.playerHTML = new PlayerHTML(videoWrapperId)
|
||||
this.playerOptionsBuilder = new PlayerOptionsBuilder(this.playerHTML, this.videoFetcher, this.peertubePlugin)
|
||||
this.liveManager = new LiveManager(this.playerHTML)
|
||||
|
@ -101,6 +104,8 @@ export class PeerTubeEmbed {
|
|||
.then(res => res.json())
|
||||
}
|
||||
|
||||
this.peertubeTheme.loadTheme(this.config)
|
||||
|
||||
const videoId = this.isPlaylistEmbed()
|
||||
? await this.initPlaylist()
|
||||
: this.getResourceId()
|
||||
|
@ -278,6 +283,8 @@ export class PeerTubeEmbed {
|
|||
video,
|
||||
captionsResponse,
|
||||
chaptersResponse,
|
||||
|
||||
config: this.config,
|
||||
translations,
|
||||
|
||||
storyboardsResponse,
|
||||
|
@ -379,6 +386,7 @@ export class PeerTubeEmbed {
|
|||
|
||||
this.peertubePlayer.unload()
|
||||
this.peertubePlayer.disable()
|
||||
|
||||
this.peertubePlayer.setPoster(video.previewPath)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue