mirror of
https://github.com/videojs/video.js.git
synced 2025-07-17 01:42:41 +02:00
@mmcc fixed an issue where errors on source tags could get missed. closes #1575
This commit is contained in:
committed by
Steve Heffernan
parent
906de96632
commit
b8cc047a2e
@ -8,6 +8,7 @@ CHANGELOG
|
|||||||
* @OlehTsvirko added a Russian translation ([view](https://github.com/videojs/video.js/pull/1563))
|
* @OlehTsvirko added a Russian translation ([view](https://github.com/videojs/video.js/pull/1563))
|
||||||
* @thijstriemstra added a Dutch translation ([view](https://github.com/videojs/video.js/pull/1566))
|
* @thijstriemstra added a Dutch translation ([view](https://github.com/videojs/video.js/pull/1566))
|
||||||
* @heff updated the poster to use CSS styles to display; fixed the poster not showing if not originally set ([view](https://github.com/videojs/video.js/pull/1568))
|
* @heff updated the poster to use CSS styles to display; fixed the poster not showing if not originally set ([view](https://github.com/videojs/video.js/pull/1568))
|
||||||
|
* @mmcc fixed an issue where errors on source tags could get missed ([view](https://github.com/videojs/video.js/pull/1575))
|
||||||
|
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ vjs.on = function(elem, type, fn){
|
|||||||
* Removes event listeners from an element
|
* Removes event listeners from an element
|
||||||
* @param {Element|Object} elem Object to remove listeners from
|
* @param {Element|Object} elem Object to remove listeners from
|
||||||
* @param {String|Array=} type Type of listener to remove. Don't include to remove all events from element.
|
* @param {String|Array=} type Type of listener to remove. Don't include to remove all events from element.
|
||||||
* @param {Function} fn Specific listener to remove. Don't incldue to remove listeners for an event type.
|
* @param {Function} fn Specific listener to remove. Don't include to remove listeners for an event type.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
vjs.off = function(elem, type, fn) {
|
vjs.off = function(elem, type, fn) {
|
||||||
|
@ -32,8 +32,11 @@ vjs.Html5 = vjs.MediaTechController.extend({
|
|||||||
|
|
||||||
var source = options['source'];
|
var source = options['source'];
|
||||||
|
|
||||||
// set the source if one was provided
|
// Set the source if one is provided
|
||||||
if (source && this.el_.currentSrc !== source.src) {
|
// 1) Check if the source is new (if not, we want to keep the original so playback isn't interrupted)
|
||||||
|
// 2) Check to see if the network state of the tag was failed at init, and if so, reset the source
|
||||||
|
// anyway so the error gets fired.
|
||||||
|
if (source && (this.el_.currentSrc !== source.src) || (player.tag && player.tag.initNetworkState_ === 3)) {
|
||||||
this.el_.src = source.src;
|
this.el_.src = source.src;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,6 +280,10 @@ vjs.Player.prototype.createEl = function(){
|
|||||||
this.width(this.options_['width'], true); // (true) Skip resize listener on load
|
this.width(this.options_['width'], true); // (true) Skip resize listener on load
|
||||||
this.height(this.options_['height'], true);
|
this.height(this.options_['height'], true);
|
||||||
|
|
||||||
|
// vjs.insertFirst seems to cause the networkState to flicker from 3 to 2, so
|
||||||
|
// keep track of the original for later so we can know if the source originally failed
|
||||||
|
tag.initNetworkState_ = tag.networkState;
|
||||||
|
|
||||||
// Wrap video tag in div (el/box) container
|
// Wrap video tag in div (el/box) container
|
||||||
if (tag.parentNode) {
|
if (tag.parentNode) {
|
||||||
tag.parentNode.insertBefore(el, tag);
|
tag.parentNode.insertBefore(el, tag);
|
||||||
|
Reference in New Issue
Block a user