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

empty player spins forever on play #764

Closed
bcjwilson opened this issue Oct 2, 2013 · 14 comments
Closed

empty player spins forever on play #764

bcjwilson opened this issue Oct 2, 2013 · 14 comments
Labels

Comments

@bcjwilson
Copy link

If you create an empty video player (a player with no content) then when the viewer hits play, it just spins forever.

Example code:

  <video
    id="examplePlayer"
    class="video-js vjs-default-skin"
    width="640"
    height="264"
    poster="http://video-js.zencoder.com/oceans-clip.png"
    controls>
    <!-- no sources -->
  </video>

<script>
videojs('examplePlayer');
</script>

It does log a Video Error event to the console, but the user sees only a spinner.

What should the player do in this case?

@heff
Copy link
Member

heff commented Oct 4, 2013

It seems like this line should be killed. We're currently relying on the spinner to show errors to the end-user, which is kind of lame. It should replaced by a more appropriate end-user error message though.

In your use case would a visible error message at this point be a problem?

@bcjwilson
Copy link
Author

It's a tough question. Now that you explain, it makes a lot of sense.

A spinner communicates to the user "hold on, I'm trying to do something, eventually good stuff will happen." In this case, it'll never get better, so the spinner is a bit misleading.

Other choices I can think of:

  • show an exclamation point, or a can't play icon (like native iOS controls do - a play button with a line through it)
  • show a real actual error message (requires localization).
  • (crazy) play a video of static

Since nothing else in vjs core currently requires localization, I'd lean away from the second option. What do you think?

@bcjwilson
Copy link
Author

I talked to @BCjwhisenant — he liked the "can't play" overlay button idea.

@heff
Copy link
Member

heff commented Oct 4, 2013

(crazy) play a video of static

lol, awesome

Yeah, the can't play icon totally makes sense. @mmcc, is there an icon in the font set we can use for that?

@gkatsev
Copy link
Member

gkatsev commented Oct 4, 2013

(crazy) play a video of static

I support this choice. Bring back my childhood of tv channels not working.

@sawyerr44
Copy link

In my particular case I would like to allow content authors to have the option to only select an image. With this option there is a chance that no videos will be selected. If this is the case, the ideal solution would load the spinner initially, check for video tags, if there are none then hide the spinner, display a message (optional) and revert back to the poster image.

@heff
Copy link
Member

heff commented Oct 8, 2013

@sawyerr44 So in your case an image could be the actual content, with no audio? By 'check for video tags' do you mean video source tags (<source>) specifically?

@sawyerr44
Copy link

@heff Yes, if no video is defined (using the source tag), the poster would become the default content without any sound. In my scenario I would like to give the author the choice of using a poster (mandatory) with or without a video. At the moment, videojs works great if you have a poster and a video. If you only have a poster, the spinner icon is rendered continuously and an error is logged.

@heff
Copy link
Member

heff commented Oct 8, 2013

@sawyerr44 Ok, got it. That's not exactly an intended use case for Video.js. The poster is meant to augment the content, not be the content itself. So I don't think we should complicate the poster/spinner stories with that requirement. The best way to approach that would be to create an image tech, like the Flash/HTML5 techs, that would allow you to use an image as the source. e.g. <source src="myImage.jpg" type="image/jpeg">.

That's probably worth opening another issue about supporting images as content, and I'd be interested to hear more about the situation where that's valuable over just just using and image tag.

@mmcc
Copy link
Member

mmcc commented Oct 8, 2013

I really think the logic for deciding what to show should be handled before a video element is even created. You mentioned authors will have the option of selecting just an image, so when your page loads just do a check like this:

if (content.hasVideo) {
  // Set up a <video> element
} else {
  // Just an IMG tag
}

This is total pseudo code since I don't know what your architecture looks like, but this is how I would handle it. Preferably something like this would happen in a template before even rendering the view, but you could also handle the logic in JS.

EDIT: Woops, thought @sawyerr44's was the original issue when I closed this. @sawyerr44: This answer is specific to your use case, but for more specific answers on this you might want to try StackOverflow.

@mmcc mmcc closed this as completed Oct 8, 2013
@mmcc mmcc reopened this Oct 8, 2013
@mmcc
Copy link
Member

mmcc commented Oct 8, 2013

In regards to the icon, my thought would be to do both an exclamation icon and make it clear the buttons are no longer going to work. Maybe add one of these exclamation icons:

exclamation stop exclamation

Then overlay something like this on top of the play button as well as disable pointers and such for controls.

disabled

@heff
Copy link
Member

heff commented Dec 3, 2013

Created #869 to address this and other no-source issues

@mmcc
Copy link
Member

mmcc commented Feb 8, 2014

Since @heff opened another issue to address this, I'm going to close this one as a dupe.

@mmcc mmcc closed this as completed Feb 8, 2014
@heff
Copy link
Member

heff commented May 13, 2014

This issue should be fixed now as of #1197

@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.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants