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 handling #1191

Closed
wants to merge 6 commits into from
Closed

Conversation

heff
Copy link
Member

@heff heff commented May 2, 2014

(This is currently a work in progress but it's getting far a long so I wanted to put it up for feedback)

Summary:

  • Better logging functions
  • Better player media error reporting
  • Visually showing that the player is broken (instead of just a lame spinner)
  • Added sinon for test stubs

screen shot 2014-05-02 at 3 34 44 pm

For logging we'd now have vjs.log, vjs.log.warn, and vjs.log.error, which all translate to the same console functions.

For the visual error, I'm just using an X now. I'd like for it to be a crossed out play button in future, similar to iOS. I don't currently think we should show any actual text in addition to the X, and instead leave that to the videojs-errors plugin that's in progress. Firefox does show a message on the player when an error happens, but other browsers just show a crossed out play button or disabled controls, or nothing at all.

Please let me know if there's any thoughts on this approach.

@mmcc
Copy link
Member

mmcc commented May 6, 2014

Is that X icon in the screenshot the one you decided to go with? Will there be any more information in the player itself or are we leaving that up to the developer?

@heff
Copy link
Member Author

heff commented May 6, 2014

The X was the best I could do for now. I can't find a good drop in 'no-play' icon, and I'm not sure how to update the icon font either way.

I've been playing around with adding descriptions for errors. At some level we have the videojs-errors plugin that will provide more rich text error messages. But for some of the basic messages I think we should show messages in core. I'm specifically thinking of the ones where the end-user can do something to fix the issue, like upgrading their browser. For errors that need the developer to fix the issue, I wonder if the console errors are enough. Though actually it might be hard to distinguish between those two situations.

screen shot 2014-05-06 at 10 23 22 am

@mmcc
Copy link
Member

mmcc commented May 6, 2014

The one thing I see potentially being a problem (or confusing for viewers) is where the developer doesn't really know what they're doing and slaps something like a WMV as the source. We'd say "no compatible source was found" and link to a page about HTML5 video support, which would do nothing but confuse the end-user. They might even upgrade to a different browser only to still see the same error message, which would be awesome because they'd have a shiny new browser, but frustrating because they still can't watch the original video.

Maybe this is an edge case we don't really need to worry about? Assume best faith of the folks implementing the player? It just seems like there are a non-trivial amount of issues opened based almost entirely on video formats, so it feels like a legitimate concern.

TL;DR, I like the last screenshot you posted, I'm just concerned we'll end up unwittingly playing a part in confusing people.

@@ -630,7 +620,15 @@ vjs.Player.prototype.techGet = function(method){
* @return {vjs.Player} self
*/
vjs.Player.prototype.play = function(){
this.techCall('play');
if (this.error()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's kind of weird to have an empty if block.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, i was considering logging an error or warning there, but i'll fix this.

@heff
Copy link
Member Author

heff commented May 7, 2014

TL;DR, I like the last screenshot you posted, I'm just concerned we'll end up unwittingly playing a part in confusing people.

@mmcc, I agree with that. I don't know that we have access to anything more specific about why it failed. How would you phrase it so it sounds less like we know that link will address your problem?

heff added a commit to heff/video.js that referenced this pull request May 9, 2014
Now clearing errors on loadstart events.
Added some default error messages.
@heff
Copy link
Member Author

heff commented May 9, 2014

Closing and moving to #1197. The comments here have been addressed.

@heff heff closed this May 9, 2014
heff added a commit that referenced this pull request May 13, 2014
Squashed commit of the following:

commit 81d7859
Author: Steve Heffernan <steve@zencoder.com>
Date:   Mon May 12 12:53:59 2014 -0700

    Removed unneeded comments

commit c7ad732
Author: Steve Heffernan <steve@zencoder.com>
Date:   Fri May 9 14:29:31 2014 -0700

    Addressed comments in #1191
    Now clearing errors on loadstart events.
    Added some default error messages.

commit a742239
Author: Steve Heffernan <steve@zencoder.com>
Date:   Wed May 7 15:38:31 2014 -0700

    Fixed the error display to hide by default

commit 561c3f8
Author: Steve Heffernan <steve@zencoder.com>
Date:   Mon May 5 10:44:47 2014 -0700

    Added support for displaying a message for the error.

commit 2214207
Author: Steve Heffernan <steve@zencoder.com>
Date:   Fri May 2 17:18:22 2014 -0700

    Updated spinner to hide on all errors

commit 95d7e70
Author: Steve Heffernan <steve@zencoder.com>
Date:   Fri May 2 15:37:44 2014 -0700

    Exported ErrorDisplay

commit 11ca9cd
Author: Steve Heffernan <steve@zencoder.com>
Date:   Fri May 2 15:35:46 2014 -0700

    Updated flash tech to support new errors

commit 56cbe66
Author: Steve Heffernan <steve@zencoder.com>
Date:   Fri May 2 13:06:49 2014 -0700

    Started on better error handling and displaying in the UI when an error has occurred.

commit 740014c
Author: Steve Heffernan <steve@zencoder.com>
Date:   Wed Apr 30 16:11:33 2014 -0700

    Added better global log/error/warn functions.
    Added sinon.js for stubs in tests.
    Updated grunt version to satisfy peer dependency warning.
@heff heff deleted the feature/error-handling branch July 1, 2014 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants