src/widgets/AutoPlayer.js
changeset 1013 392ddcd212d7
parent 987 7b65bf78873a
child 1042 a128e59ca2b1
equal deleted inserted replaced
1012:7e18d953a1f8 1013:392ddcd212d7
     4 
     4 
     5 IriSP.Widgets.AutoPlayer.prototype = new IriSP.Widgets.Widget();
     5 IriSP.Widgets.AutoPlayer.prototype = new IriSP.Widgets.Widget();
     6 
     6 
     7 IriSP.Widgets.AutoPlayer.prototype.defaults = {
     7 IriSP.Widgets.AutoPlayer.prototype.defaults = {
     8     default_type: "JwpPlayer"
     8     default_type: "JwpPlayer"
     9 }
     9 };
    10 
    10 
    11 IriSP.Widgets.AutoPlayer.prototype.draw = function() {
    11 IriSP.Widgets.AutoPlayer.prototype.draw = function() {
    12     
    12     
    13     if (typeof this.video === "undefined") {
    13     if (typeof this.video === "undefined") {
    14         this.video = this.media.video;
    14         this.video = this.media.video;
    50             break;
    50             break;
    51         }
    51         }
    52     }
    52     }
    53     
    53     
    54     if (typeof _opts.type === "undefined") {
    54     if (typeof _opts.type === "undefined") {
    55         _opts.type = this.default_type
    55         _opts.type = this.default_type;
    56     }
    56     }
    57     
    57     
    58     if (_opts.type === "AdaptivePlayer") {
    58     if (_opts.type === "AdaptivePlayer") {
    59         var _canPlayType = document.createElement('video').canPlayType("video/mp4");
    59         var _canPlayType = document.createElement('video').canPlayType("video/mp4");
    60         _opts.type = (_canPlayType == "maybe" || _canPlayType == "probably") ? "HtmlPlayer" : "JwpPlayer";
    60         _opts.type = (_canPlayType == "maybe" || _canPlayType == "probably") ? "HtmlPlayer" : "JwpPlayer";
    71         }
    71         }
    72     }
    72     }
    73 
    73 
    74     this.insertSubwidget(this.$, _opts);
    74     this.insertSubwidget(this.$, _opts);
    75     
    75     
    76 }
    76 };