]>
Commit | Line | Data |
---|---|---|
a51bad1a | 1 | import { catchError } from 'rxjs/operators' |
3b492bff | 2 | import { ChangeDetectorRef, Component, ElementRef, Inject, LOCALE_ID, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' |
df98563e | 3 | import { ActivatedRoute, Router } from '@angular/router' |
901637bb | 4 | import { RedirectService } from '@app/core/routing/redirect.service' |
0bd78bf3 | 5 | import { peertubeLocalStorage } from '@app/shared/misc/peertube-local-storage' |
07fa4c97 | 6 | import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-support.component' |
1f3e9fec C |
7 | import { MetaService } from '@ngx-meta/core' |
8 | import { NotificationsService } from 'angular2-notifications' | |
16f7022b | 9 | import { forkJoin, Subscription } from 'rxjs' |
63c4db6d | 10 | import * as videojs from 'video.js' |
d7701449 | 11 | import 'videojs-hotkeys' |
caae7a06 | 12 | import * as WebTorrent from 'webtorrent' |
040467f5 | 13 | import { UserVideoRateType, VideoPrivacy, VideoRateType, VideoState } from '../../../../../shared' |
aa8b6df4 | 14 | import '../../../assets/player/peertube-videojs-plugin' |
df98563e | 15 | import { AuthService, ConfirmService } from '../../core' |
a51bad1a | 16 | import { RestExtractor, VideoBlacklistService } from '../../shared' |
ff249f49 | 17 | import { VideoDetails } from '../../shared/video/video-details.model' |
b1fa3eba | 18 | import { Video } from '../../shared/video/video.model' |
63c4db6d | 19 | import { VideoService } from '../../shared/video/video.service' |
202f6b6c | 20 | import { MarkdownService } from '../shared' |
4635f59d C |
21 | import { VideoDownloadComponent } from './modal/video-download.component' |
22 | import { VideoReportComponent } from './modal/video-report.component' | |
23 | import { VideoShareComponent } from './modal/video-share.component' | |
2186386c | 24 | import { addContextMenu, getVideojsOptions, loadLocale } from '../../../assets/player/peertube-player' |
0883b324 | 25 | import { ServerService } from '@app/core' |
989e526a | 26 | import { I18n } from '@ngx-translate/i18n-polyfill' |
e945b184 | 27 | import { environment } from '../../../environments/environment' |
74b7c6d4 | 28 | import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils' |
16f7022b C |
29 | import { VideoCaptionService } from '@app/shared/video-caption' |
30 | import { VideoCaption } from '../../../../../shared/models/videos/video-caption.model' | |
dc8bc31b | 31 | |
dc8bc31b C |
32 | @Component({ |
33 | selector: 'my-video-watch', | |
ec8d8440 C |
34 | templateUrl: './video-watch.component.html', |
35 | styleUrls: [ './video-watch.component.scss' ] | |
dc8bc31b | 36 | }) |
0629423c | 37 | export class VideoWatchComponent implements OnInit, OnDestroy { |
22b59e80 C |
38 | private static LOCAL_STORAGE_PRIVACY_CONCERN_KEY = 'video-watch-privacy-concern' |
39 | ||
a96aed15 | 40 | @ViewChild('videoDownloadModal') videoDownloadModal: VideoDownloadComponent |
df98563e C |
41 | @ViewChild('videoShareModal') videoShareModal: VideoShareComponent |
42 | @ViewChild('videoReportModal') videoReportModal: VideoReportComponent | |
07fa4c97 | 43 | @ViewChild('videoSupportModal') videoSupportModal: VideoSupportComponent |
df98563e | 44 | |
57a49263 | 45 | otherVideosDisplayed: Video[] = [] |
b1fa3eba | 46 | |
df98563e | 47 | player: videojs.Player |
0826c92d | 48 | playerElement: HTMLVideoElement |
154898b0 | 49 | userRating: UserVideoRateType = null |
404b54e1 | 50 | video: VideoDetails = null |
80958c78 | 51 | descriptionLoading = false |
2de96f4d C |
52 | |
53 | completeDescriptionShown = false | |
54 | completeVideoDescription: string | |
55 | shortVideoDescription: string | |
9d9597df | 56 | videoHTMLDescription = '' |
e9189001 | 57 | likesBarTooltipText = '' |
73e09f27 | 58 | hasAlreadyAcceptedPrivacyConcern = false |
6d88de72 | 59 | remoteServerDown = false |
df98563e | 60 | |
e945b184 | 61 | private videojsLocaleLoaded = false |
28832412 | 62 | private otherVideos: Video[] = [] |
df98563e | 63 | private paramsSub: Subscription |
df98563e C |
64 | |
65 | constructor ( | |
4fd8aa32 | 66 | private elementRef: ElementRef, |
3b492bff | 67 | private changeDetector: ChangeDetectorRef, |
0629423c | 68 | private route: ActivatedRoute, |
92fb909c | 69 | private router: Router, |
d3ef341a | 70 | private videoService: VideoService, |
35bf0c83 | 71 | private videoBlacklistService: VideoBlacklistService, |
92fb909c | 72 | private confirmService: ConfirmService, |
3ec343a4 | 73 | private metaService: MetaService, |
7ddd02c9 | 74 | private authService: AuthService, |
0883b324 | 75 | private serverService: ServerService, |
a51bad1a | 76 | private restExtractor: RestExtractor, |
9d9597df | 77 | private notificationsService: NotificationsService, |
7ae71355 | 78 | private markdownService: MarkdownService, |
901637bb | 79 | private zone: NgZone, |
989e526a | 80 | private redirectService: RedirectService, |
16f7022b | 81 | private videoCaptionService: VideoCaptionService, |
e945b184 C |
82 | private i18n: I18n, |
83 | @Inject(LOCALE_ID) private localeId: string | |
d3ef341a | 84 | ) {} |
dc8bc31b | 85 | |
b2731bff C |
86 | get user () { |
87 | return this.authService.getUser() | |
88 | } | |
89 | ||
df98563e | 90 | ngOnInit () { |
0bd78bf3 C |
91 | if ( |
92 | WebTorrent.WEBRTC_SUPPORT === false || | |
93 | peertubeLocalStorage.getItem(VideoWatchComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY) === 'true' | |
94 | ) { | |
2b3b76ab C |
95 | this.hasAlreadyAcceptedPrivacyConcern = true |
96 | } | |
97 | ||
b1fa3eba | 98 | this.videoService.getVideos({ currentPage: 1, itemsPerPage: 5 }, '-createdAt') |
2186386c C |
99 | .subscribe( |
100 | data => { | |
101 | this.otherVideos = data.videos | |
102 | this.updateOtherVideosDisplayed() | |
103 | }, | |
649fb082 | 104 | |
2186386c C |
105 | err => console.error(err) |
106 | ) | |
b1fa3eba | 107 | |
13fc89f4 | 108 | this.paramsSub = this.route.params.subscribe(routeParams => { |
2186386c | 109 | const uuid = routeParams[ 'uuid' ] |
a51bad1a | 110 | |
244e76a5 | 111 | // Video did not change |
1263fc4e | 112 | if (this.video && this.video.uuid === uuid) return |
bf079b7b C |
113 | |
114 | if (this.player) this.player.pause() | |
115 | ||
244e76a5 | 116 | // Video did change |
16f7022b C |
117 | forkJoin( |
118 | this.videoService.getVideo(uuid), | |
119 | this.videoCaptionService.listCaptions(uuid) | |
120 | ) | |
121 | .pipe( | |
122 | catchError(err => this.restExtractor.redirectTo404IfNotFound(err, [ 400, 404 ])) | |
123 | ) | |
124 | .subscribe(([ video, captionsResult ]) => { | |
125 | const startTime = this.route.snapshot.queryParams.start | |
126 | this.onVideoFetched(video, captionsResult.data, startTime) | |
127 | .catch(err => this.handleError(err)) | |
128 | }) | |
df98563e | 129 | }) |
d1992b93 C |
130 | } |
131 | ||
df98563e | 132 | ngOnDestroy () { |
09edde40 | 133 | this.flushPlayer() |
067e3f84 | 134 | |
13fc89f4 | 135 | // Unsubscribe subscriptions |
df98563e | 136 | this.paramsSub.unsubscribe() |
dc8bc31b | 137 | } |
98b01bac | 138 | |
df98563e C |
139 | setLike () { |
140 | if (this.isUserLoggedIn() === false) return | |
57a49263 BB |
141 | if (this.userRating === 'like') { |
142 | // Already liked this video | |
143 | this.setRating('none') | |
144 | } else { | |
145 | this.setRating('like') | |
146 | } | |
d38b8281 C |
147 | } |
148 | ||
df98563e C |
149 | setDislike () { |
150 | if (this.isUserLoggedIn() === false) return | |
57a49263 BB |
151 | if (this.userRating === 'dislike') { |
152 | // Already disliked this video | |
153 | this.setRating('none') | |
154 | } else { | |
155 | this.setRating('dislike') | |
156 | } | |
d38b8281 C |
157 | } |
158 | ||
1f30a185 | 159 | async blacklistVideo (event: Event) { |
df98563e | 160 | event.preventDefault() |
ab683a8e | 161 | |
989e526a | 162 | const res = await this.confirmService.confirm(this.i18n('Do you really want to blacklist this video?'), this.i18n('Blacklist')) |
1f30a185 | 163 | if (res === false) return |
198b205c | 164 | |
1f30a185 | 165 | this.videoBlacklistService.blacklistVideo(this.video.id) |
2186386c C |
166 | .subscribe( |
167 | () => { | |
168 | this.notificationsService.success( | |
169 | this.i18n('Success'), | |
170 | this.i18n('Video {{videoName}} had been blacklisted.', { videoName: this.video.name }) | |
171 | ) | |
172 | this.redirectService.redirectToHomepage() | |
173 | }, | |
174 | ||
175 | error => this.notificationsService.error(this.i18n('Error'), error.message) | |
176 | ) | |
198b205c GS |
177 | } |
178 | ||
2de96f4d | 179 | showMoreDescription () { |
2de96f4d C |
180 | if (this.completeVideoDescription === undefined) { |
181 | return this.loadCompleteDescription() | |
182 | } | |
183 | ||
184 | this.updateVideoDescription(this.completeVideoDescription) | |
80958c78 | 185 | this.completeDescriptionShown = true |
2de96f4d C |
186 | } |
187 | ||
188 | showLessDescription () { | |
2de96f4d | 189 | this.updateVideoDescription(this.shortVideoDescription) |
80958c78 | 190 | this.completeDescriptionShown = false |
2de96f4d C |
191 | } |
192 | ||
193 | loadCompleteDescription () { | |
80958c78 C |
194 | this.descriptionLoading = true |
195 | ||
2de96f4d | 196 | this.videoService.loadCompleteDescription(this.video.descriptionPath) |
2186386c C |
197 | .subscribe( |
198 | description => { | |
199 | this.completeDescriptionShown = true | |
200 | this.descriptionLoading = false | |
201 | ||
202 | this.shortVideoDescription = this.video.description | |
203 | this.completeVideoDescription = description | |
204 | ||
205 | this.updateVideoDescription(this.completeVideoDescription) | |
206 | }, | |
207 | ||
208 | error => { | |
209 | this.descriptionLoading = false | |
210 | this.notificationsService.error(this.i18n('Error'), error.message) | |
211 | } | |
212 | ) | |
2de96f4d C |
213 | } |
214 | ||
df98563e C |
215 | showReportModal (event: Event) { |
216 | event.preventDefault() | |
217 | this.videoReportModal.show() | |
4f8c0eb0 C |
218 | } |
219 | ||
07fa4c97 C |
220 | showSupportModal () { |
221 | this.videoSupportModal.show() | |
222 | } | |
223 | ||
df98563e C |
224 | showShareModal () { |
225 | this.videoShareModal.show() | |
99cc4f49 C |
226 | } |
227 | ||
a96aed15 | 228 | showDownloadModal (event: Event) { |
df98563e | 229 | event.preventDefault() |
a96aed15 | 230 | this.videoDownloadModal.show() |
99cc4f49 C |
231 | } |
232 | ||
df98563e C |
233 | isUserLoggedIn () { |
234 | return this.authService.isLoggedIn() | |
4f8c0eb0 C |
235 | } |
236 | ||
4635f59d C |
237 | isVideoUpdatable () { |
238 | return this.video.isUpdatableBy(this.authService.getUser()) | |
239 | } | |
240 | ||
df98563e | 241 | isVideoBlacklistable () { |
b2731bff | 242 | return this.video.isBlackistableBy(this.user) |
198b205c GS |
243 | } |
244 | ||
6de36768 C |
245 | getVideoPoster () { |
246 | if (!this.video) return '' | |
247 | ||
248 | return this.video.previewUrl | |
249 | } | |
250 | ||
b1fa3eba C |
251 | getVideoTags () { |
252 | if (!this.video || Array.isArray(this.video.tags) === false) return [] | |
253 | ||
4278710d | 254 | return this.video.tags |
b1fa3eba C |
255 | } |
256 | ||
6725d05c C |
257 | isVideoRemovable () { |
258 | return this.video.isRemovableBy(this.authService.getUser()) | |
259 | } | |
260 | ||
1f30a185 | 261 | async removeVideo (event: Event) { |
6725d05c C |
262 | event.preventDefault() |
263 | ||
989e526a | 264 | const res = await this.confirmService.confirm(this.i18n('Do you really want to delete this video?'), this.i18n('Delete')) |
1f30a185 | 265 | if (res === false) return |
6725d05c | 266 | |
1f30a185 | 267 | this.videoService.removeVideo(this.video.id) |
2186386c C |
268 | .subscribe( |
269 | status => { | |
270 | this.notificationsService.success( | |
271 | this.i18n('Success'), | |
272 | this.i18n('Video {{videoName}} deleted.', { videoName: this.video.name }) | |
273 | ) | |
274 | ||
275 | // Go back to the video-list. | |
276 | this.redirectService.redirectToHomepage() | |
277 | }, | |
278 | ||
279 | error => this.notificationsService.error(this.i18n('Error'), error.message) | |
280 | ) | |
6725d05c C |
281 | } |
282 | ||
73e09f27 | 283 | acceptedPrivacyConcern () { |
0bd78bf3 | 284 | peertubeLocalStorage.setItem(VideoWatchComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY, 'true') |
73e09f27 C |
285 | this.hasAlreadyAcceptedPrivacyConcern = true |
286 | } | |
287 | ||
2186386c C |
288 | isVideoToTranscode () { |
289 | return this.video && this.video.state.id === VideoState.TO_TRANSCODE | |
290 | } | |
291 | ||
bbe0f064 C |
292 | hasVideoScheduledPublication () { |
293 | return this.video && this.video.scheduledUpdate !== undefined | |
294 | } | |
295 | ||
2de96f4d C |
296 | private updateVideoDescription (description: string) { |
297 | this.video.description = description | |
298 | this.setVideoDescriptionHTML() | |
299 | } | |
300 | ||
301 | private setVideoDescriptionHTML () { | |
07fa4c97 | 302 | this.videoHTMLDescription = this.markdownService.textMarkdownToHTML(this.video.description) |
2de96f4d C |
303 | } |
304 | ||
e9189001 | 305 | private setVideoLikesBarTooltipText () { |
2186386c C |
306 | this.likesBarTooltipText = this.i18n('{{likesNumber}} likes / {{dislikesNumber}} dislikes', { |
307 | likesNumber: this.video.likes, | |
308 | dislikesNumber: this.video.dislikes | |
309 | }) | |
e9189001 C |
310 | } |
311 | ||
0c31c33d C |
312 | private handleError (err: any) { |
313 | const errorMessage: string = typeof err === 'string' ? err : err.message | |
bf5685f0 C |
314 | if (!errorMessage) return |
315 | ||
6d88de72 | 316 | // Display a message in the video player instead of a notification |
0f7fedc3 | 317 | if (errorMessage.indexOf('from xs param') !== -1) { |
6d88de72 C |
318 | this.flushPlayer() |
319 | this.remoteServerDown = true | |
3b492bff C |
320 | this.changeDetector.detectChanges() |
321 | ||
6d88de72 | 322 | return |
0c31c33d C |
323 | } |
324 | ||
6d88de72 | 325 | this.notificationsService.error(this.i18n('Error'), errorMessage) |
0c31c33d C |
326 | } |
327 | ||
df98563e | 328 | private checkUserRating () { |
d38b8281 | 329 | // Unlogged users do not have ratings |
df98563e | 330 | if (this.isUserLoggedIn() === false) return |
d38b8281 C |
331 | |
332 | this.videoService.getUserVideoRating(this.video.id) | |
2186386c C |
333 | .subscribe( |
334 | ratingObject => { | |
335 | if (ratingObject) { | |
336 | this.userRating = ratingObject.rating | |
337 | } | |
338 | }, | |
339 | ||
340 | err => this.notificationsService.error(this.i18n('Error'), err.message) | |
341 | ) | |
d38b8281 C |
342 | } |
343 | ||
16f7022b | 344 | private async onVideoFetched (video: VideoDetails, videoCaptions: VideoCaption[], startTime = 0) { |
df98563e | 345 | this.video = video |
92fb909c | 346 | |
c448d412 C |
347 | // Re init attributes |
348 | this.descriptionLoading = false | |
349 | this.completeDescriptionShown = false | |
6d88de72 | 350 | this.remoteServerDown = false |
c448d412 | 351 | |
649fb082 | 352 | this.updateOtherVideosDisplayed() |
57a49263 | 353 | |
0883b324 | 354 | if (this.video.isVideoNSFWForUser(this.user, this.serverService.getConfig())) { |
22b59e80 | 355 | const res = await this.confirmService.confirm( |
989e526a C |
356 | this.i18n('This video contains mature or explicit content. Are you sure you want to watch it?'), |
357 | this.i18n('Mature or explicit content') | |
d6e32a2e | 358 | ) |
901637bb | 359 | if (res === false) return this.redirectService.redirectToHomepage() |
92fb909c C |
360 | } |
361 | ||
09edde40 C |
362 | // Flush old player if needed |
363 | this.flushPlayer() | |
b891f9bc C |
364 | |
365 | // Build video element, because videojs remove it on dispose | |
366 | const playerElementWrapper = this.elementRef.nativeElement.querySelector('#video-element-wrapper') | |
367 | this.playerElement = document.createElement('video') | |
368 | this.playerElement.className = 'video-js vjs-peertube-skin' | |
e7eb5b39 | 369 | this.playerElement.setAttribute('playsinline', 'true') |
b891f9bc C |
370 | playerElementWrapper.appendChild(this.playerElement) |
371 | ||
16f7022b C |
372 | const playerCaptions = videoCaptions.map(c => ({ |
373 | label: c.language.label, | |
374 | language: c.language.id, | |
375 | src: environment.apiUrl + c.captionPath | |
376 | })) | |
377 | ||
b891f9bc C |
378 | const videojsOptions = getVideojsOptions({ |
379 | autoplay: this.isAutoplay(), | |
09edde40 | 380 | inactivityTimeout: 2500, |
b891f9bc | 381 | videoFiles: this.video.files, |
16f7022b | 382 | videoCaptions: playerCaptions, |
b891f9bc | 383 | playerElement: this.playerElement, |
f5a2dc48 | 384 | videoViewUrl: this.video.privacy.id !== VideoPrivacy.PRIVATE ? this.videoService.getVideoViewUrl(this.video.uuid) : null, |
b891f9bc C |
385 | videoDuration: this.video.duration, |
386 | enableHotkeys: true, | |
387 | peertubeLink: false, | |
f37bad63 | 388 | poster: this.video.previewUrl, |
054a103b C |
389 | startTime, |
390 | theaterMode: true | |
b891f9bc | 391 | }) |
aa8b6df4 | 392 | |
e945b184 | 393 | if (this.videojsLocaleLoaded === false) { |
74b7c6d4 | 394 | await loadLocale(environment.apiUrl, videojs, isOnDevLocale() ? getDevLocale() : this.localeId) |
e945b184 C |
395 | this.videojsLocaleLoaded = true |
396 | } | |
397 | ||
b891f9bc | 398 | const self = this |
e945b184 | 399 | this.zone.runOutsideAngular(async () => { |
09edde40 | 400 | videojs(this.playerElement, videojsOptions, function () { |
b891f9bc C |
401 | self.player = this |
402 | this.on('customError', (event, data) => self.handleError(data.err)) | |
e945b184 C |
403 | |
404 | addContextMenu(self.player, self.video.embedUrl) | |
22b59e80 | 405 | }) |
b891f9bc | 406 | }) |
22b59e80 C |
407 | |
408 | this.setVideoDescriptionHTML() | |
409 | this.setVideoLikesBarTooltipText() | |
410 | ||
411 | this.setOpenGraphTags() | |
412 | this.checkUserRating() | |
92fb909c C |
413 | } |
414 | ||
57a49263 BB |
415 | private setRating (nextRating) { |
416 | let method | |
417 | switch (nextRating) { | |
418 | case 'like': | |
419 | method = this.videoService.setVideoLike | |
420 | break | |
421 | case 'dislike': | |
422 | method = this.videoService.setVideoDislike | |
423 | break | |
424 | case 'none': | |
425 | method = this.videoService.unsetVideoLike | |
426 | break | |
427 | } | |
428 | ||
429 | method.call(this.videoService, this.video.id) | |
2186386c C |
430 | .subscribe( |
431 | () => { | |
432 | // Update the video like attribute | |
433 | this.updateVideoRating(this.userRating, nextRating) | |
434 | this.userRating = nextRating | |
435 | }, | |
436 | ||
437 | err => this.notificationsService.error(this.i18n('Error'), err.message) | |
438 | ) | |
57a49263 BB |
439 | } |
440 | ||
154898b0 | 441 | private updateVideoRating (oldRating: UserVideoRateType, newRating: VideoRateType) { |
df98563e C |
442 | let likesToIncrement = 0 |
443 | let dislikesToIncrement = 0 | |
d38b8281 C |
444 | |
445 | if (oldRating) { | |
df98563e C |
446 | if (oldRating === 'like') likesToIncrement-- |
447 | if (oldRating === 'dislike') dislikesToIncrement-- | |
d38b8281 C |
448 | } |
449 | ||
df98563e C |
450 | if (newRating === 'like') likesToIncrement++ |
451 | if (newRating === 'dislike') dislikesToIncrement++ | |
d38b8281 | 452 | |
df98563e C |
453 | this.video.likes += likesToIncrement |
454 | this.video.dislikes += dislikesToIncrement | |
20b40b19 | 455 | |
22b59e80 | 456 | this.video.buildLikeAndDislikePercents() |
20b40b19 | 457 | this.setVideoLikesBarTooltipText() |
d38b8281 C |
458 | } |
459 | ||
649fb082 | 460 | private updateOtherVideosDisplayed () { |
f6dc2fff | 461 | if (this.video && this.otherVideos && this.otherVideos.length > 0) { |
649fb082 C |
462 | this.otherVideosDisplayed = this.otherVideos.filter(v => v.uuid !== this.video.uuid) |
463 | } | |
464 | } | |
465 | ||
df98563e C |
466 | private setOpenGraphTags () { |
467 | this.metaService.setTitle(this.video.name) | |
758b996d | 468 | |
df98563e | 469 | this.metaService.setTag('og:type', 'video') |
3ec343a4 | 470 | |
df98563e C |
471 | this.metaService.setTag('og:title', this.video.name) |
472 | this.metaService.setTag('name', this.video.name) | |
3ec343a4 | 473 | |
df98563e C |
474 | this.metaService.setTag('og:description', this.video.description) |
475 | this.metaService.setTag('description', this.video.description) | |
3ec343a4 | 476 | |
d38309c3 | 477 | this.metaService.setTag('og:image', this.video.previewPath) |
3ec343a4 | 478 | |
df98563e | 479 | this.metaService.setTag('og:duration', this.video.duration.toString()) |
3ec343a4 | 480 | |
df98563e | 481 | this.metaService.setTag('og:site_name', 'PeerTube') |
3ec343a4 | 482 | |
df98563e C |
483 | this.metaService.setTag('og:url', window.location.href) |
484 | this.metaService.setTag('url', window.location.href) | |
3ec343a4 | 485 | } |
1f3e9fec | 486 | |
d4c6a3b9 | 487 | private isAutoplay () { |
bf079b7b C |
488 | // We'll jump to the thread id, so do not play the video |
489 | if (this.route.snapshot.params['threadId']) return false | |
490 | ||
491 | // Otherwise true by default | |
d4c6a3b9 C |
492 | if (!this.user) return true |
493 | ||
494 | // Be sure the autoPlay is set to false | |
495 | return this.user.autoPlayVideo !== false | |
496 | } | |
09edde40 C |
497 | |
498 | private flushPlayer () { | |
499 | // Remove player if it exists | |
500 | if (this.player) { | |
501 | this.player.dispose() | |
502 | this.player = undefined | |
503 | } | |
504 | } | |
dc8bc31b | 505 | } |