videojs / videojs-errors

A video.js plugin that displays error messages to video viewers.
Other
88 stars 29 forks source link

Added option to disable watching progress #91

Closed forbesjo closed 7 years ago

forbesjo commented 7 years ago

Description

This PR adds a flag to disable watching the progress event. The reason for this is that progress coming from the video element doesn't really mean anything when using MSE.

Specific Changes proposed

Added player.errors.disableProgress() to disable watching progress events. Defaults to false.

Requirements Checklist

mjneil commented 7 years ago

If a user wants to call player.errors(customOptions) to re-initialize the plugin with custom options, I think this would cause progress events to be un-ignored if the plugin was re-initialized after the disableProgress api is called.

forbesjo commented 7 years ago

That's true, the new API would also not be available when using a source element.

misteroneill commented 7 years ago

@mjneil That's correct, but I would say that's a feature not a bug. When you reinitialize this plugin, I think you'd expect whatever options you have provided to be the new options (not merged with the previous invocation).

@forbesjo Not sure what you mean by "when using a source element"...

mjneil commented 7 years ago

I assume its related to this

forbesjo commented 7 years ago
<video id=example-video width=600 height=300 class="video-js vjs-default-skin" controls>
  <source
     src="https://example.com/dash.mpd"
     type="application/dash+xml">
</video>

I'm under the impression that when setting a source this way the source handler cannot create a reference to the player and therefore cannot access its plugins. We saw a similar problem with the qualityLevels plugin

misteroneill commented 7 years ago

That seems... wrong, but maybe I'm not thinking clearly. Regardless, that doesn't sound like it stops this PR from moving forward.

forbesjo commented 7 years ago

It was either using the source element or setting a source as an option through videojs(). Either way this a niche setting that will be done the proper way eventually with middleware