src/widgets/PopcornPlayer.js
changeset 967 b4c6e64acb2d
parent 959 ee11ed1b739e
child 970 b1c3bf6eca78
equal deleted inserted replaced
966:c1c762ad1697 967:b4c6e64acb2d
    44             var _ppart = _urlparts[i].split('=');
    44             var _ppart = _urlparts[i].split('=');
    45             _params[_ppart[0]] = decodeURIComponent(_ppart[1]);
    45             _params[_ppart[0]] = decodeURIComponent(_ppart[1]);
    46         }
    46         }
    47         _params.controls = 0;
    47         _params.controls = 0;
    48         _params.modestbranding = 1;
    48         _params.modestbranding = 1;
       
    49         if (this.autostart || this.autoplay) {
       
    50             _params.autoplay = 1;
       
    51         }
    49         _url = _urlparts[0] + '?' + IriSP.jQuery.param(_params);
    52         _url = _urlparts[0] + '?' + IriSP.jQuery.param(_params);
    50         
    53         
    51         var _popcorn = Popcorn.youtube(this.container, _url);
    54         var _popcorn = Popcorn.youtube(this.container, _url);
    52         
    55         
    53     } else {
    56     } else {
    73                 _videoEl.append(_srcNode);
    76                 _videoEl.append(_srcNode);
    74             }
    77             }
    75         }
    78         }
    76         this.$.html(_videoEl);
    79         this.$.html(_videoEl);
    77         var _popcorn = Popcorn("#" + _tmpId);
    80         var _popcorn = Popcorn("#" + _tmpId);
       
    81         if (this.autostart || this.autoplay) {
       
    82             _popcorn.autoplay(true);
       
    83         }
    78     }
    84     }
       
    85     
    79 
    86 
    80     // Binding functions to Popcorn
    87     // Binding functions to Popcorn
    81     
    88     
    82     this.media.getCurrentTime = function() {
    89     this.media.getCurrentTime = function() {
    83         return new IriSP.Model.Time(1000*_popcorn.currentTime());
    90         return new IriSP.Model.Time(1000*_popcorn.currentTime());