1
0
mirror of https://github.com/videojs/video.js.git synced 2025-07-03 00:57:02 +02:00

The base media tech class now checks the networkState at init to determine if loadstart should be manually fired.

Previously this was only done in the HTML5 tech, but Flash needs it as well. This relies on videojs/video-js-swf#106.

Also removed the 'not implemented' warnings from the media tech functions. I think there's a better way we can help tech authors here, and it was blocking the ability to check if a function was implemented for real.

Fixes #1300, fixes #1341
This commit is contained in:
Steve Heffernan
2014-07-10 19:18:58 -07:00
parent ab520e9dd7
commit 7debdea507
2 changed files with 15 additions and 24 deletions

View File

@ -29,12 +29,8 @@ vjs.Html5 = vjs.MediaTechController.extend({
var source = options['source'];
// If the element source is already set, we may have missed the loadstart event, and want to trigger it.
// We don't want to set the source again and interrupt playback.
if (source && this.el_.currentSrc === source.src && this.el_.networkState > 0) {
player.trigger('loadstart');
// Otherwise set the source if one was provided.
} else if (source) {
// set the source if one was provided
if (source && this.el_.currentSrc !== source.src) {
this.el_.src = source.src;
}
@ -247,6 +243,8 @@ vjs.Html5.prototype.defaultMuted = function(){ return this.el_.defaultMuted; };
vjs.Html5.prototype.playbackRate = function(){ return this.el_.playbackRate; };
vjs.Html5.prototype.setPlaybackRate = function(val){ this.el_.playbackRate = val; };
vjs.Html5.prototype.networkState = function(){ return this.el_.networkState; };
/* HTML5 Support Testing ---------------------------------------------------- */
vjs.Html5.isSupported = function(){