Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better error reporting #1035

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

Better error reporting #1035

binarykitchen opened this issue Feb 25, 2014 · 13 comments

Comments

@binarykitchen
Copy link

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
Copy link
Author

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

@mmcc
Copy link
Member

mmcc commented Feb 25, 2014

How are you setting el?

@binarykitchen
Copy link
Author

Through document.getElementById()

@mmcc
Copy link
Member

mmcc commented Feb 25, 2014

Strange. Can you reproduce using JSBin?

@binarykitchen
Copy link
Author

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
Copy link
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
Copy link
Author

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
Copy link
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
Copy link
Member

heff commented Feb 28, 2014

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

@heff
Copy link
Member

heff commented Mar 4, 2014

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

@heff
Copy link
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
Copy link
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
Copy link
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 as completed May 21, 2014
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants