| author | ymh <ymh.work@gmail.com> |
| Fri, 02 Oct 2015 11:27:17 +0200 | |
| changeset 1068 | 7623f9af9272 |
| parent 1042 | a128e59ca2b1 |
| child 1072 | ac1eacb3aa33 |
| permissions | -rw-r--r-- |
| 968 | 1 |
IriSP.Widgets.AdaptivePlayer = function(player, config) { |
| 967 | 2 |
IriSP.Widgets.Widget.call(this, player, config); |
3 |
}; |
|
4 |
||
| 968 | 5 |
IriSP.Widgets.AdaptivePlayer.prototype = new IriSP.Widgets.Widget(); |
| 967 | 6 |
|
| 968 | 7 |
IriSP.Widgets.AdaptivePlayer.prototype.defaults = { |
|
1042
a128e59ca2b1
change h264 detection for adaptive player + auto player
ymh <ymh.work@gmail.com>
parents:
1013
diff
changeset
|
8 |
mime_type: 'video/mp4; codecs="avc1.42E01E"', |
| 987 | 9 |
normal_player: "HtmlPlayer", |
| 967 | 10 |
fallback_player: "JwpPlayer" |
| 1013 | 11 |
}; |
| 967 | 12 |
|
| 968 | 13 |
IriSP.Widgets.AdaptivePlayer.prototype.draw = function() { |
| 967 | 14 |
|
15 |
if (typeof this.video === "undefined") { |
|
16 |
this.video = this.media.video; |
|
17 |
} |
|
18 |
|
|
19 |
var _props = [ "autostart", "video", "height", "width", "url_transform" ], |
|
20 |
_opts = {}, |
|
21 |
_canPlayType = document.createElement('video').canPlayType(this.mime_type); |
|
22 |
|
|
|
1042
a128e59ca2b1
change h264 detection for adaptive player + auto player
ymh <ymh.work@gmail.com>
parents:
1013
diff
changeset
|
23 |
_opts.type = (_canPlayType !== "no") ? this.normal_player : this.fallback_player; |
| 967 | 24 |
|
25 |
for (var i = 0; i < _props.length; i++) { |
|
26 |
if (typeof this[_props[i]] !== "undefined") { |
|
27 |
_opts[_props[i]] = this[_props[i]]; |
|
28 |
} |
|
29 |
} |
|
30 |
||
31 |
this.insertSubwidget(this.$, _opts); |
|
32 |
|
|
| 1013 | 33 |
}; |