# HG changeset patch # User veltr # Date 1349174677 -7200 # Node ID 03c88ba5de2cecf43f8ad38484222c0b9eb9e46f # Parent b4c6e64acb2d2bc7c56cd949dd0632451cd9b410 Renamed H264 player to Adaptive Player diff -r b4c6e64acb2d -r 03c88ba5de2c src/widgets/AdaptivePlayer.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/widgets/AdaptivePlayer.js Tue Oct 02 12:44:37 2012 +0200 @@ -0,0 +1,33 @@ +IriSP.Widgets.AdaptivePlayer = function(player, config) { + IriSP.Widgets.Widget.call(this, player, config); +}; + +IriSP.Widgets.AdaptivePlayer.prototype = new IriSP.Widgets.Widget(); + +IriSP.Widgets.AdaptivePlayer.prototype.defaults = { + mime_type: "video/mp4", + normal_player: "PopcornPlayer", + fallback_player: "JwpPlayer" +} + +IriSP.Widgets.AdaptivePlayer.prototype.draw = function() { + + if (typeof this.video === "undefined") { + this.video = this.media.video; + } + + var _props = [ "autostart", "video", "height", "width", "url_transform" ], + _opts = {}, + _canPlayType = document.createElement('video').canPlayType(this.mime_type); + + _opts.type = (_canPlayType == "maybe" || _canPlayType == "probably") ? this.normal_player : this.fallback_player; + + for (var i = 0; i < _props.length; i++) { + if (typeof this[_props[i]] !== "undefined") { + _opts[_props[i]] = this[_props[i]]; + } + } + + this.insertSubwidget(this.$, _opts); + +} \ No newline at end of file diff -r b4c6e64acb2d -r 03c88ba5de2c src/widgets/H264Player.js --- a/src/widgets/H264Player.js Tue Oct 02 12:05:15 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -IriSP.Widgets.H264Player = function(player, config) { - IriSP.Widgets.Widget.call(this, player, config); -}; - -IriSP.Widgets.H264Player.prototype = new IriSP.Widgets.Widget(); - -IriSP.Widgets.H264Player.prototype.defaults = { - mime_type: "video/mp4", - normal_player: "PopcornPlayer", - fallback_player: "JwpPlayer" -} - -IriSP.Widgets.H264Player.prototype.draw = function() { - - if (typeof this.video === "undefined") { - this.video = this.media.video; - } - - var _props = [ "autostart", "video", "height", "width", "url_transform" ], - _opts = {}, - _canPlayType = document.createElement('video').canPlayType(this.mime_type); - - _opts.type = (_canPlayType == "maybe" || _canPlayType == "probably") ? this.normal_player : this.fallback_player; - - for (var i = 0; i < _props.length; i++) { - if (typeof this[_props[i]] !== "undefined") { - _opts[_props[i]] = this[_props[i]]; - } - } - - this.insertSubwidget(this.$, _opts); - -} \ No newline at end of file diff -r b4c6e64acb2d -r 03c88ba5de2c test/mp4video.htm --- a/test/mp4video.htm Tue Oct 02 12:05:15 2012 +0200 +++ b/test/mp4video.htm Tue Oct 02 12:44:37 2012 +0200 @@ -30,7 +30,7 @@ css : 'metadataplayer/LdtPlayer-core.css', widgets: [ { - type: "H264Player", + type: "AdaptivePlayer", video: "trailer.mp4" }, { type: "Sparkline" }, diff -r b4c6e64acb2d -r 03c88ba5de2c test/oggvideo.htm --- a/test/oggvideo.htm Tue Oct 02 12:05:15 2012 +0200 +++ b/test/oggvideo.htm Tue Oct 02 12:44:37 2012 +0200 @@ -29,10 +29,7 @@ }, css : 'metadataplayer/LdtPlayer-core.css', widgets: [ - { - type: "PopcornPlayer", - autostart: true - }, + { type: "PopcornPlayer" }, { type: "Sparkline" }, { type: "Slider" }, { type: "Controller" },