From 3bcfff7f446d0a1d8ef5adf340375e178259a42c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 14 Feb 2018 17:20:39 +0100 Subject: Fix video play promise error on non supported browsers --- client/src/app/shared/video/infinite-scroller.directive.ts | 1 + client/src/app/videos/+video-watch/video-watch.component.ts | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'client/src/app') diff --git a/client/src/app/shared/video/infinite-scroller.directive.ts b/client/src/app/shared/video/infinite-scroller.directive.ts index 52d8b2b37..1da02f60f 100644 --- a/client/src/app/shared/video/infinite-scroller.directive.ts +++ b/client/src/app/shared/video/infinite-scroller.directive.ts @@ -1,6 +1,7 @@ import { Directive, EventEmitter, Input, OnInit, Output } from '@angular/core' import 'rxjs/add/operator/debounceTime' import 'rxjs/add/operator/distinct' +import 'rxjs/add/operator/distinctUntilChanged' import 'rxjs/add/operator/filter' import 'rxjs/add/operator/map' import 'rxjs/add/operator/startWith' diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index b7779ae9a..7a64406e6 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts @@ -330,7 +330,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy { videoFiles: this.video.files, playerElement: this.playerElement, peerTubeLink: false, - videoViewUrl: this.videoService.getVideoViewUrl(this.video.uuid) + videoViewUrl: this.videoService.getVideoViewUrl(this.video.uuid), + videoDuration: this.video.duration }, hotkeys: { enableVolumeScroll: false @@ -350,7 +351,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy { }) }) } else { - this.player.peertube().setVideoFiles(this.video.files, this.videoService.getVideoViewUrl(this.video.uuid)) + const videoViewUrl = this.videoService.getVideoViewUrl(this.video.uuid) + this.player.peertube().setVideoFiles(this.video.files, videoViewUrl, this.video.duration) } this.setVideoDescriptionHTML() -- cgit v1.2.3