1
0
mirror of https://github.com/videojs/video.js.git synced 2025-07-17 01:42:41 +02:00

Fixed some IE comma errors. Made ajax error clearer. Fixed a setup issue.

This commit is contained in:
Steve Heffernan
2011-11-29 16:39:43 -08:00
parent 82d55c45e7
commit 0c7334c861
6 changed files with 16 additions and 11 deletions

View File

@ -37,6 +37,7 @@
<source src="http://www.youtube.com/watch?v=YjaZNYSt7o0&feature=related" type='video/youtube'> <source src="http://www.youtube.com/watch?v=YjaZNYSt7o0&feature=related" type='video/youtube'>
<track kind="subtitles" src="http://videojs.com/subtitles/demo-subtitles.srt" srclang="en-US" label="English"></track> <track kind="subtitles" src="http://videojs.com/subtitles/demo-subtitles.srt" srclang="en-US" label="English"></track>
<!-- <track kind="subtitles" src="demo-subtitles.srt" srclang="en-US" label="English"></track> --> <!-- <track kind="subtitles" src="demo-subtitles.srt" srclang="en-US" label="English"></track> -->
<p>Video Playback Not Supported</p>
</video> </video>
<script> <script>

2
src/controls.js vendored
View File

@ -693,7 +693,7 @@ _V_.TextTrackDisplay = _V_.Component.extend({
createElement: function(){ createElement: function(){
return this._super("div", { return this._super("div", {
className: "vjs-" + this.trackType, className: "vjs-" + this.trackType
}); });
}, },

View File

@ -35,7 +35,7 @@ var VideoJS = function(id, addOptions, ready){
// Element may have a player attr referring to an already created player instance. // Element may have a player attr referring to an already created player instance.
// If not, set up a new player and return the instance. // If not, set up a new player and return the instance.
return tag.player || new _V_.Player(id, addOptions, ready); return tag.player || new _V_.Player(tag, addOptions, ready);
}, },
// Shortcut // Shortcut

View File

@ -59,6 +59,7 @@ _V_.extend({
} }
return el; return el;
}, },
insertFirst: function(node, parent){ insertFirst: function(node, parent){
if (parent.firstChild) { if (parent.firstChild) {
parent.insertBefore(parent.firstChild, node); parent.insertBefore(parent.firstChild, node);
@ -66,11 +67,13 @@ _V_.extend({
parent.appendChild(node); parent.appendChild(node);
} }
}, },
addClass: function(element, classToAdd){ addClass: function(element, classToAdd){
if ((" "+element.className+" ").indexOf(" "+classToAdd+" ") == -1) { if ((" "+element.className+" ").indexOf(" "+classToAdd+" ") == -1) {
element.className = element.className === "" ? classToAdd : element.className + " " + classToAdd; element.className = element.className === "" ? classToAdd : element.className + " " + classToAdd;
} }
}, },
removeClass: function(element, classToRemove){ removeClass: function(element, classToRemove){
if (element.className.indexOf(classToRemove) == -1) { return; } if (element.className.indexOf(classToRemove) == -1) { return; }
var classNames = element.className.split(" "); var classNames = element.className.split(" ");
@ -235,7 +238,7 @@ _V_.extend({
try { try {
request.open("GET", url); request.open("GET", url);
} catch(e) { } catch(e) {
_V_.log(e); _V_.log("VideoJS XMLHttpRequest (open)", e);
// onError(e); // onError(e);
return false; return false;
} }
@ -253,7 +256,7 @@ _V_.extend({
try { try {
request.send(); request.send();
} catch(e) { } catch(e) {
_V_.log(e); _V_.log("VideoJS XMLHttpRequest (send)", e);
onError(e); onError(e);
} }
}, },

View File

@ -30,9 +30,9 @@ _V_.Player = _V_.Component.extend({
// This fixes the Safari issue by removing the poster, which is currently never used again after // This fixes the Safari issue by removing the poster, which is currently never used again after
// the video starts playing. // the video starts playing.
if (!paused) { if (!paused) {
options.poster = tag.poster // options.poster = tag.poster
tag.poster = null; // tag.poster = null;
tag.play(); // tag.play();
} }
// Give video tag properties to box // Give video tag properties to box
@ -193,7 +193,6 @@ _V_.Player = _V_.Component.extend({
// Add tech element to player div // Add tech element to player div
if (this.techs[techName] === undefined) { if (this.techs[techName] === undefined) {
this.techs[techName] = this.tech = new _V_[techName](this, { source: source }); this.techs[techName] = this.tech = new _V_[techName](this, { source: source });
_V_.insertFirst(this.tech.el, this.el);
} else { } else {
this.tech = this.techs[techName]; this.tech = this.techs[techName];
_V_.insertFirst(this.techs[techName].el, this.el); _V_.insertFirst(this.techs[techName].el, this.el);

View File

@ -222,15 +222,17 @@ _V_.H5swf = _V_.PlaybackTech.extend({
name: "H5swf", name: "H5swf",
// swf: "flash/video-js.swf", // swf: "flash/video-js.swf",
swf: "https://s3.amazonaws.com/video-js/3.0b/video-js.swf", // swf: "https://s3.amazonaws.com/video-js/3.0b/video-js.swf",
// swf: "http://video-js.zencoder.com/3.0b/video-js.swf", // swf: "http://video-js.zencoder.com/3.0b/video-js.swf",
swf: "http://video-js.com/test/video-js.swf",
// swf: "video-js.swf",
init: function(player, options){ init: function(player, options){
this.player = player; this.player = player;
// this.el = this.createElement(); // this.el = this.createElement();
var source = options.source, var source = options.source,
placeHolder = _V_.createElement("div", { id: player.el.id + "_temp_h5swf" }), placeHolder = this.el = _V_.createElement("div", { id: player.el.id + "_temp_h5swf" }),
objId = player.el.id+"_h5swf_api", objId = player.el.id+"_h5swf_api",
flashvars = { flashvars = {
@ -242,7 +244,7 @@ _V_.H5swf = _V_.PlaybackTech.extend({
preload: player.options.preload, preload: player.options.preload,
loop: player.options.loop, loop: player.options.loop,
muted: player.options.muted, muted: player.options.muted,
poster: player.options.poster, poster: player.options.poster
}, },
params = { params = {