| author | Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com> |
| Fri, 13 May 2016 13:04:44 +0200 | |
| changeset 1349 | f9b3f9009c7c |
| parent 1304 | 10974bff4dae |
| permissions | -rw-r--r-- |
| 694 | 1 |
IriSP.Widgets.AdaptivePlayer = function(player, config) { |
2 |
IriSP.Widgets.Widget.call(this, player, config); |
|
3 |
}; |
|
4 |
||
5 |
IriSP.Widgets.AdaptivePlayer.prototype = new IriSP.Widgets.Widget(); |
|
6 |
||
7 |
IriSP.Widgets.AdaptivePlayer.prototype.defaults = { |
|
|
1304
10974bff4dae
upgrade metadataplayer + publish enmi 14and 15
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
955
diff
changeset
|
8 |
mime_type: 'video/mp4; codecs="avc1.42E01E"', |
| 765 | 9 |
normal_player: "HtmlPlayer", |
| 694 | 10 |
fallback_player: "JwpPlayer" |
| 955 | 11 |
}; |
| 694 | 12 |
|
13 |
IriSP.Widgets.AdaptivePlayer.prototype.draw = function() { |
|
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 |
|
|
|
1304
10974bff4dae
upgrade metadataplayer + publish enmi 14and 15
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
955
diff
changeset
|
23 |
_opts.type = (_canPlayType !== "no") ? this.normal_player : this.fallback_player; |
| 694 | 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 |
|
|
| 955 | 33 |
}; |