Skip to content
This repository has been archived by the owner on Sep 30, 2021. It is now read-only.

Error message doesn't show up on Chrome 59 #1221

Closed
foliovision opened this issue Jul 26, 2017 · 5 comments
Closed

Error message doesn't show up on Chrome 59 #1221

foliovision opened this issue Jul 26, 2017 · 5 comments
Assignees
Milestone

Comments

@foliovision
Copy link

I found this issue when playing http://mydoctor.kpnvly.org/rehabilitation/wp-content/uploads/sites/4/2016/01/2.0_-_2.1_Pre_Surgery_Exercise_Intro.m4v

Here is ffprobe output for that file:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'http://mydoctor.kpnvly.org/rehabilitation/wp-content/uploads/sites/4/2016/01/2.0_-_2.1_Pre_Surgery_Exercise_Intro.m4v':

Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 2015-11-17T08:00:00.000000Z
encoder : Lavf53.18.0
Duration: 00:01:16.79, start: 0.000000, bitrate: 226 kb/s

Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 864x484, 103 kb/s, 23.98 fps, 23.98 tbr, 2997 tbn, 47.95 tbc (default)
Metadata:
  creation_time   : 2015-11-17T08:00:00.000000Z
  handler_name    : VideoHandler

Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 117 kb/s (default)
Metadata:
  creation_time   : 2015-11-17T08:00:00.000000Z
  handler_name    : SoundHandler

Here is the error which I got when using Chrome 59.0.3071.125 on Adroind 4.4.4 (Samsung X-Cover - SM-G388F):

Uncaught TypeError: Cannot assign to read only property 'message' of object '#'
at flowplayer-7.0.4.js:3273
at HTMLDivElement.internalHandler (flowplayer-7.0.4.js:1609)
at Object.obj.trigger (flowplayer-7.0.4.js:1672)
at triggerEvent (flowplayer-7.0.4.js:1040)
at HTMLDivElement.l (flowplayer-7.0.4.js:1153)

Uncaught (in promise) DOMException: Failed to load because no supported source was found.

I see it's caused by this line:

error.message = conf.errors[error.code];

I'm attaching a pull request where I put a simple try-catch around that line in the error event handler. That way there is no JavaScript error and the error message provided by Google Chrome which actually reads "DECODER_ERROR_NOT_SUPPORTED video decoder initialization fialed" appears properly.

The video plays fine on Android 5.1.1 (Asus) or Android 6.0 (Lenovo) though.

Thanks,
Martin

@foliovision
Copy link
Author

Now I'm getting the same behavior on Chrome 59. When I put in some video file that doesn't exist there should be some error message about it but there isn't, it just shows that error on console.

So I believe Chrome 59 made the message property of the error read only and that's it.

But is it important to put your custom message into error.message at all? I updated my fix with something simpler - it just puts in the Flowplayer error message up and doesn't alter error.message.

@foliovision foliovision changed the title Error message doesn't show up for encoding issues on Android 4 Error message doesn't show up on Chrome 59 Jul 26, 2017
@foliovision
Copy link
Author

I also noticed that for Chrome's DECODER_ERROR_NOT_SUPPORTED error the error code is set to 4 = "Video file not found", but it should be 3 = "Video not properly encoded", so I added some code for that.

@phloxic
Copy link
Contributor

phloxic commented Jul 26, 2017

From a practical point of view:
The question is whether this is a 'transient' Chrome issue, it would not be the first.
While there are shifting timestamp issues with that video - you'll notice when you run ffprobe -v debug on it - it may well be that it works again with the next upgrade.

Also DECODER_ERROR_NOT_SUPPORTED is not standard, it probably means exactly what it says: This Chrome's decoder cannot deal with this video.

@foliovision - arguably the 'custom' message assigned to error.code is a user facing convenience, but the interpretation of error.code for other purposes - whether to recover or not for example - depends on some consistency in those codes anyway, see below.

@nnarhinen - what should be revisited imho is:

  1. The asignment of error symptoms to their code, according to https://html.spec.whatwg.org/multipage/media.html#error-codes (which is also what the reference in the source http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#error-codes redirects to) 4 is MEDIA_ERR_SRC_NOT_SUPPORTED (not custom Flowplayer 5 code), and may be 2 MEDIA_ERR_NETWORK should include (or set to) 'Video file not found' - compare with https://flowplayer.com/docs/api.html#error-codes
  2. otoh the question is how strict clients adhere to the standard

@foliovision
Copy link
Author

@blacktrash I was getting the same issue even in Chrome 60.0.3112.78.

I can also see that error on console here: http://demos.flowplayer.org/scripting/recover.html

And on http://demos.flowplayer.org/basics/bad-url.html it shows no error for the first video because of the same reason.

@phloxic phloxic added this to the 7.0.5 milestone Jul 29, 2017
@phloxic
Copy link
Contributor

phloxic commented Jul 29, 2017

@nnarhinen - I can confirm this. At least regarding the symptoms. So http://demos.flowplayer.org/basics/bad-url.html shows error 4 in the console - "code: 4, message: MEDIA_ELEMENT_ERROR: Format error", however api.error is undefined, and no error message is shown.

http://demos.flowplayer.org/scripting/recover.html recovers because the player reacts to error 4. Presumably at least. Unless the broken play() promise does something, but I doubt it because the play() promise scenario is not covered in core.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants