1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-31 03:11:11 +02:00

Removed dist version. Minor changes/optimizations.

This commit is contained in:
Steve Heffernan 2011-11-17 16:28:49 -08:00
parent 3fc71d098d
commit c5a22081b4
7 changed files with 29 additions and 3301 deletions

View File

@ -42,18 +42,14 @@
<script src="src/autoload.js"></script>
<script type="text/javascript" src="flash/swfobject.js"></script>
<script src="flash/swfobject.js"></script>
</head>
<body>
<video src="http://video-js.zencoder.com/oceans-clip.mp4" id="vid1" class="video-js vjs-default-skin" autoplay preload="auto" width="640" height="264"
poster="http://video-js.zencoder.com/oceans-clip.png"></video>
<video id="vid1" class="video-js vjs-default-skin" autoplay preload="auto" width="640" height="264"
poster="http://video-js.zencoder.com/oceans-clip.png">
<!-- data-setup='{"techOrder":["html5","h5swf","youtube"]}'> -->
poster="http://video-js.zencoder.com/oceans-clip.png"
data-setup='{"techOrder":["html5","h5swf","youtube"]}'>
<source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4'>
<source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm'>
<source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg; codecs="theora, vorbis"'>

3285
dev/dist/video.js vendored

File diff suppressed because one or more lines are too long

View File

@ -116,7 +116,7 @@ VideoJS.fn.extend({
// Turn on fullscreen (or window) mode
enterFullScreen: function(){
if (false && this.supportsFullScreen()) {
if (this.supportsFullScreen()) {
this.api("enterFullScreen");
} else {
this.enterFullWindow();
@ -287,8 +287,8 @@ VideoJS.fn.extend({
videoHeight: function(){ return this.apiCall("videoHeight"); },
defaultPlaybackRate: function(){ return this.apiCall("defaultPlaybackRate"); },
playbackRate: function(){ return this.apiCall("playbackRate"); },
mediaGroup: function(){ return this.apiCall("mediaGroup"); },
controller: function(){ return this.apiCall("controller"); },
// mediaGroup: function(){ return this.apiCall("mediaGroup"); },
// controller: function(){ return this.apiCall("controller"); },
controls: function(){ return this.apiCall("controls"); },
defaultMuted: function(){ return this.apiCall("defaultMuted"); }
});

View File

@ -23,6 +23,8 @@ VideoJS.fn.newBehavior("box",
================================================================================ */
VideoJS.fn.newBehavior("tech",
function(element){
// Need to add click event to video element instead of box, otherwise box will
// catch clicks on all control buttons. (Could add stopPropagation to all, but don't want to if not needed yet.)
_V_.addEvent(element, "click", _V_.proxy(this, this.onPlayToggleClick));
},
function(element){

View File

@ -1,3 +1,4 @@
/* OLD VERSION OF CONTROL BAR */
_V_.controlSets.main = {
options: {},
add: function(){

View File

@ -11,8 +11,7 @@ var VideoJS = _V_ = function(id, addOptions, ready){
// Allow for element or ID to be passed in.
var tag = (typeof id == "string" ? _V_.el(id) : id);
if (!tag || !tag.nodeName) { // Could be a box div also
throw new TypeError("The element or ID supplied is not valid. (video.js)");
return;
throw new TypeError("The element or ID supplied is not valid. (video.js)"); // Returns
}
// Check if (not) using "new" operator before the function to create new instance
@ -23,6 +22,7 @@ var VideoJS = _V_ = function(id, addOptions, ready){
}
this.tag = tag; // Store the original tag used to set options
var box = this.box = _V_.createElement("div"), // Div to contain video and controls
options = this.options = {},
width = options.width = tag.width,
@ -30,7 +30,10 @@ var VideoJS = _V_ = function(id, addOptions, ready){
// Browsers default to 300x150 if there's no width/height or video size data.
initWidth = width || 300,
initHeight = height || 150;
initHeight = height || 150,
// If the HTML5 video is already playing, we'll adjust
paused = tag.paused;
// Make player findable on elements
tag.player = box.player = this;
@ -39,6 +42,16 @@ var VideoJS = _V_ = function(id, addOptions, ready){
tag.parentNode.insertBefore(box, tag);
box.appendChild(tag); // Breaks iPhone, fixed in HTML5 setup.
// Safari (5.1.1) and Chrome (15) both have issues when you use autoplay and a poster and no controls.
// Chrome just hides the video. Safari hides the video if you move it in the DOM like VJS does.
// This fixes the Safari issue by removing the poster, which is currently never used again after
// the video starts playing.
if (!paused) {
options.poster = tag.poster
tag.poster = null;
tag.play();
}
// Give video tag properties to box
box.id = this.id = tag.id; // ID will now reference box, not the video tag
box.className = tag.className;
@ -115,7 +128,8 @@ var VideoJS = _V_ = function(id, addOptions, ready){
// Return Player Obj (though API will not be ready yet)
return this;
};
}, _V_ = VideoJS;
VideoJS.options = {
techOrder: ["html5","flowplayer","h5swf"],
@ -204,7 +218,7 @@ VideoJS.fn = VideoJS.prototype = {
this.triggerReady();
// Make playback element clickable
this.addBehavior(this.currentTechElement, "tech");
this.addBehavior(this.currentTechElement, "playToggle");
// Manually track progress in cases where the browser/flash player doesn't report it.
if (!_V_.techSupports(tech, "event", "progress")) { this.manualProgressOn(); }

View File

@ -6,7 +6,7 @@ _V_.Track = function(attributes, player){
this.kind = attributes.kind;
this.srclang = attributes.srclang;
this.label = attributes.label;
this["default"] = attributes["default"];
this["default"] = attributes["default"]; // 'default' is reserved-ish
this.title = attributes.title;
this.cues = [];