import { Observable } from 'rxjs/Observable'
import { Subscription } from 'rxjs/Subscription'
-import * as videojs from 'video.js'
-import { MetaService } from '@nglibs/meta'
+import videojs from 'video.js'
+import { MetaService } from '@ngx-meta/core'
import { NotificationsService } from 'angular2-notifications'
import { AuthService, ConfirmService } from '../../core'
const videojsOptions = {
controls: true,
- autoplay: false
+ autoplay: true
}
const self = this
this.loading = false
console.log('Added ' + this.video.magnetUri + '.')
- torrent.files[0].renderTo(this.playerElement, { autoplay: true }, (err) => {
+ torrent.files[0].renderTo(this.playerElement, (err) => {
if (err) {
this.notificationsService.error('Error', 'Cannot append the file in the video element.')
console.error(err)
}
+
+ // Hack to "simulate" src link in video.js >= 6
+ // If no, we can't play the video after pausing it
+ // https://github.com/videojs/video.js/blob/master/src/js/player.js#L1633
+ (this.player as any).src = () => true
+
+ this.player.play()
})
this.runInProgress(torrent)
this.videoService.getUserVideoRating(this.video.id)
.subscribe(
- (ratingObject: UserVideoRate) => {
+ ratingObject => {
if (ratingObject) {
this.userRating = ratingObject.rating
}