mirror of
https://github.com/videojs/video.js.git
synced 2025-02-06 11:51:07 +02:00
Fixed issues from comments on d7f840a9693a73a4764eba2d5c7c0cb4b7120c80
- use triple equals - don't block play call on error
This commit is contained in:
parent
bad5130c8f
commit
0c3fb04acb
@ -3,12 +3,12 @@
|
||||
* @param {Number} code The media error code
|
||||
*/
|
||||
vjs.MediaError = function(code){
|
||||
if (typeof code == 'number') {
|
||||
if (typeof code === 'number') {
|
||||
this.code = code;
|
||||
} else if (typeof code == 'string') {
|
||||
} else if (typeof code === 'string') {
|
||||
// default code is zero, so this is a custom error
|
||||
this.message = code;
|
||||
} else if (typeof code == 'object') { // object
|
||||
} else if (typeof code === 'object') { // object
|
||||
vjs.obj.merge(this, code);
|
||||
}
|
||||
|
||||
|
@ -629,14 +629,7 @@ vjs.Player.prototype.techGet = function(method){
|
||||
* @return {vjs.Player} self
|
||||
*/
|
||||
vjs.Player.prototype.play = function(){
|
||||
// In the case of an error, trying to play again wont fix the issue
|
||||
// so we're blocking calling play in this case.
|
||||
// We might log an error when this happpens, but this is probably too chatty.
|
||||
// vjs.log.error('The error must be resolved before attempting to play the video');
|
||||
if (!this.error()) {
|
||||
this.techCall('play');
|
||||
}
|
||||
|
||||
this.techCall('play');
|
||||
return this;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user