1
0
mirror of https://github.com/videojs/video.js.git synced 2025-02-04 11:43:27 +02:00

Updated to show links if only unplayable sources and no Flash.

This commit is contained in:
Steve Heffernan 2010-11-05 18:03:56 -07:00
parent 864e5bca0c
commit ea57810e4e
2 changed files with 10 additions and 1 deletions

View File

@ -137,6 +137,7 @@ Changelog
- Fix: Fix issue where FF would loop video in background when ended.
- Fix: Bug in Chrome that shows poster & plays audio if you set currentTime too quickly.
- Fix: Bug in Safari where waiting is triggered and shows spinner when not needed
- Fix: Updated to show links if only unplayable sources and no Flash.
1.1.3

View File

@ -63,8 +63,11 @@ var VideoJS = JRClass.extend({
this.linksFallback = this.getLinksFallback();
// Hide download links if video can play
if (VideoJS.browserSupportsVideo() && this.canPlaySource()) {
this.hideLinksFallback();
// Hide if using Flash and version is supported
// Flash fallback can't be found in IE. Maybe add video as an element like modernizr so it can contain elements.
if(VideoJS.browserSupportsVideo() || ((this.flashFallback || VideoJS.isIE()) && this.flashVersionSupported())) {
} else if ((this.flashFallback || VideoJS.isIE()) && this.flashVersionSupported()) {
this.hideLinksFallback();
}
@ -563,16 +566,21 @@ var VideoJS = JRClass.extend({
},
canPlaySource: function(){
// Cache Result
if (this.canPlaySourceResult) { return this.canPlaySourceResult; }
// Loop through sources and check if any can play
var children = this.video.children;
for (var i=0,j=children.length; i<j; i++) {
if (children[i].tagName.toUpperCase() == "SOURCE") {
var canPlay = this.video.canPlayType(children[i].type);
if(canPlay == "probably" || canPlay == "maybe") {
this.firstPlayableSource = children[i];
this.canPlaySourceResult = true;
return true;
}
}
}
this.canPlaySourceResult = false;
return false;
},