src/widgets/videojs_plugins/Dailymotion.js
changeset 1079 d4f0681c4ff1
parent 1076 510fd2a482f4
equal deleted inserted replaced
1078:c28fb800e252 1079:d4f0681c4ff1
     9 class Dailymotion extends Tech {
     9 class Dailymotion extends Tech {
    10   constructor(options, ready) {
    10   constructor(options, ready) {
    11     super(options, ready);
    11     super(options, ready);
    12 
    12 
    13     this.setSrc(this.options_.source);
    13     this.setSrc(this.options_.source);
    14     console.log(this.options_.source)
       
    15 
    14 
    16     // Set the vjs-dailymotion class to the player
    15     // Set the vjs-dailymotion class to the player
    17     // Parent is not set yet so we have to wait a tick
    16     // Parent is not set yet so we have to wait a tick
    18     setTimeout( () => {
    17     setTimeout( () => {
    19       if (this.el_) {
    18       if (this.el_) {
   109 
   108 
   110     return playerConfig;
   109     return playerConfig;
   111   }
   110   }
   112 
   111 
   113   async initDMPlayer() {
   112   async initDMPlayer() {
   114     console.log("INIT DM Player", this._getPlayerConfig());
       
   115     if (this.dmPlayer) {
   113     if (this.dmPlayer) {
   116       return;
   114       return;
   117     }
   115     }
   118     const eventMapping = {
   116     const eventMapping = {
   119       [dailymotion.events.VIDEO_DURATIONCHANGE]: [ "durationchange" ],
   117       [dailymotion.events.VIDEO_DURATIONCHANGE]: [ "durationchange" ],
   133     );
   131     );
   134     this.dmState = await this.getPlayerState();
   132     this.dmState = await this.getPlayerState();
   135     //var vm = this;
   133     //var vm = this;
   136     this.isApiReady = true;
   134     this.isApiReady = true;
   137     this.dmPlayer.enable_playback_controls = false;
   135     this.dmPlayer.enable_playback_controls = false;
   138     console.log("AUTONEXT", this.dmPlayer.enable_playback_controls);
       
   139 
   136 
   140     for (const ev in eventMapping) {
   137     for (const ev in eventMapping) {
   141       this.dmPlayer.on(ev, (s) => {
   138       this.dmPlayer.on(ev, (s) => {
   142         this.dmState = s;
   139         this.dmState = s;
   143         for (const tev of eventMapping[ev]) {
   140         for (const tev of eventMapping[ev]) {