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

Handle no-source and broken sources #869

Closed
heff opened this issue Dec 3, 2013 · 8 comments
Closed

Handle no-source and broken sources #869

heff opened this issue Dec 3, 2013 · 8 comments

Comments

@heff
Copy link
Member

heff commented Dec 3, 2013

In the case where no supported sources are supplied to the video tag, the player should show a broken playback image.

View this example to see how different platforms handle the issue.
http://jsbin.com/OXEyuboL/1/edit

Case: no sources supplied at all (#764)
--> Empty video, no icon

Case: sources supplied, none supported or file error (#868)
--> Broken playback icon

In both cases:

  • the play button should not show
  • the spinner should not show

See #764 for more discussion around this.

Also see #796 and #798 for a beginning implementation. And #746.

Based on the media-load-algorithm:

IF there is no src attribute or source elements
--> Do not fire an error
--> Set networkState to NETWORK_EMPTY
--> Show disabled or no controls
        Safari Desktop: Controls, "loading...", play button responds to click but no result or error
        Safari iOS: No controls
        Chrome: Controls are grayed and disabled
        Firefox: Controls still work, including big play button, but nothing happens after clicking play
IF there is an empty src attribute or failure to load the src attribute source
--> Set networkState to NETWORK_NO_SOURCE
--> Fire an error event on the player (no bubble)
--> Set player.error() to 4 - MEDIA_ERR_SRC_NOT_SUPPORTED
--> Show disabled or no controls
        Firefox shows an X icon, "video format or mime type is not supported"
        Chrome shows disabled controls
        Safari Desktop shows controls that don't work. "loading..." is NOT displayed
IF there are source elements and each source element is not supported or fails
--> Set networkState to NETWORK_NO_SOURCE
--> Do not fire an error
--> Show disabled or no controls
        Firefox shows an X icon, "No video with supported format and MIME type found"
        Chrome shows disabled controls
        Safari Desktop shows controls that don't work. "loading..." is NOT displayed

It seems a little odd that when no source elements are supported, the player goes into a waiting state instead of firing an error. In order to know that the source selection algorithm failed on source elements you would have to listen for an error on the last source element. I don't think we could manually trigger that error on a source element, so that would make it hard to duplicate this process.

@chrisroos
Copy link

Are you planning on handling unsupported sources as part of this enhancement? Or is it focussed on missing and broken sources? I ask because your jsbin example mentions unsupported sources but they're not mentioned elsewhere in this issue.

If the plan is to unify the handling of no, broken and unsupported sources then I think this would/could address issue #1164 too.

@heff
Copy link
Member Author

heff commented Apr 28, 2014

Yeah, I'd definitely like to include #1164 in this as well. I'm diving in today to get a better idea of what all of it will take.

@heff heff added this to the v4.6.0 milestone May 1, 2014
@chrisroos
Copy link

Hey @heff. Did you get anywhere with your most recent investigation? Is there anything I can do to help?

@heff
Copy link
Member Author

heff commented May 9, 2014

Yeah, check out #1181 (merged) and #1191 (open PR). I think I have good progress there, so if you could check them out and let me know what you think that'd be great.

@heff
Copy link
Member Author

heff commented May 21, 2014

The items here and in the related issues were addressed in version 4.6.0. Please update and try it out!

@heff heff closed this as completed May 21, 2014
@mmcc mmcc mentioned this issue Oct 3, 2014
@mmcc
Copy link
Member

mmcc commented Oct 3, 2014

Looks like this might actually still be an issue. Here's a JSBin, but in Chrome I get nothing but the loading spinner if there are no sources altogether or the sources are blank. Firefox (sometimes) shows the error. For some reason I can see it in edit mode for JSBin, but not in the standalone-preview mode.

@aitoraznar
Copy link

I think we can handle the "no source" error in each technology.

Html5: on vjs.Html5.prototype.eventHandler
Flash: on vjs.Flash['onError']
Hls: on this.playlists.on('error', ...

If we detect the "no source" error, we can trigger a custom event ('srcnotfound') and retry the sources in a handler ('onSrcNotFound').

I have typed it with expected results. Yes, with a test would be better.

@mmcc
Copy link
Member

mmcc commented Jul 25, 2015

Seems to be fixed in 4.12

@mmcc mmcc closed this as completed Jul 25, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants