Skip to content

Better error reporting #1035

Closed
binarykitchen opened this Issue Feb 25, 2014 · 13 comments

5 participants

@binarykitchen

Original title: Weird error message

I see a weird error message without any information when I initialise with a reference to the video element like that:

videojs(el);

the error message in the console is:

["Video Error", Object]
0: "Video Error"
1: Object
AT_TARGET: 2
BLUR: 8192
BUBBLING_PHASE: 3
CAPTURING_PHASE: 1
CHANGE: 32768
CLICK: 64
DBLCLICK: 128
DRAGDROP: 2048
FOCUS: 4096
KEYDOWN: 256
KEYPRESS: 1024
KEYUP: 512
MOUSEDOWN: 1
MOUSEDRAG: 32
MOUSEMOVE: 16
MOUSEOUT: 8
MOUSEOVER: 4
MOUSEUP: 2
NONE: 0
SELECT: 16384
bubbles: false
cancelBubble: true
cancelable: true
clipboardData: undefined
currentTarget: video#vjs_video_1_html5_api.vjs-tech
defaultPrevented: false
eventPhase: 2
initEvent: function initEvent() { [native code] }
isDefaultPrevented: function returnFalse() { return false; }
isImmediatePropagationStopped: function returnFalse() { return false; }
isPropagationStopped: function returnTrue() { return true; }
preventDefault: function () {
relatedTarget: undefined
srcElement: video#vjs_video_1_html5_api.vjs-tech
stopImmediatePropagation: function () {
stopPropagation: function () {
target: video#vjs_video_1_html5_api.vjs-tech
timeStamp: 1393293795396
type: "error"
which: undefined
__proto__: Object
length: 2
__proto__: Array[0]

What does this mean??

@binarykitchen

PS: Version is the latest I installed via bower, 4.4.1

@mmcc
Video.js member
mmcc commented Feb 25, 2014

How are you setting el?

@binarykitchen

Through document.getElementById()

@mmcc
Video.js member
mmcc commented Feb 25, 2014

Strange. Can you reproduce using JSBin?

@binarykitchen

Sorry, cannot do that. My prototype is huge. Cannot extract the code into a smaller piece. I am using the racvtive.js framework among many other libraries.

All I am saying that the error message is poor. I wish there is more information in the error message!

@gkatsev
Video.js member
gkatsev commented Feb 25, 2014

That looks like an event object that gets logged.
Can you provide more information about the video file, video element attributes, and videojs options you used?

@binarykitchen

Exactly, looks like an event object.

The video files were a simple MP4 and WebM of mine, the video element attributes were (jade syntax):

video(poster="{{video.image}}", preload="auto", controls="controls", autobuffer, height="{{ video.image_height ? video.image_height : '' }}")
    source(src="{{video.mp4}}", type="video/mp4")
    source(src="{{video.webm}}", type="video/webm")

I instantiated the videojs instance without options and callback. Not needed. Just with

videojs(el);

after DOM ready.

@imbcmdth
Video.js member

IMO the function vjs.Player.prototype.onError could be a little more verbose in it's output. It would be nice if it dug into the media object to see if there is an error code and print something along the lines of:

Video Error: MEDIA_ERR_DECODE [Event Here]
@heff
Video.js member
heff commented Feb 28, 2014

Yeah, that would be better. @imbcmdth, interested in making a pull request for that?

@heff
Video.js member
heff commented Mar 4, 2014

Changed the title to "Better error reporting" and confirmed as an (unclaimed) enhancement.

@heff
Video.js member
heff commented Apr 25, 2014

I may be able to address this with #869.

@heff heff added this to the v4.6.0 milestone May 1, 2014
@heff
Video.js member
heff commented May 13, 2014

This situation should be handled better now as of #1197 (merged into master), if anyone wants to try it out

@heff
Video.js member
heff commented May 21, 2014

Better error handling was added in version 4.6.0. Please update and try it out. I'm going to close this but let me know if you don't think it's fixed.

@heff heff closed this May 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.