WIP: Plyr play error
Summary
Part-way to closing #2377
When debugging I noticed errors being thrown from Plyr before the parent components init had succeeded; This raised an alarm bell as media pages should not be auto-playing to start with. The modals should be when they are clicked, but not on a media page.
It appears as though if autoplay is provided as an @input, it tries to auto-play straight away, in turn throwing an error because the component is not ready https://developers.google.com/web/updates/2017/06/play-request-was-interrupted
Steps to test
On production, just open your console and load a video (e.g. the randomly selected https://www.minds.com/media/1060934327732535296)
To test, check this error does not show on the sandbox.
Estimated Regression Scope
I can only foresee the worst-case scenario as being a regression in the auto-playing of videos; perhaps when opening a modal; this is not the case though by my testing.
added scoped labels
- Developer
Struggling to test right now as the video does not appear to be working on sandbox.
Regardless as the play button just hangs, this has shown me another avenue for this bug to occur.
- Developer
Ah, that one does occur inside of the plyr package, so there isn't much we can do about that one other than report and whitelist.
It can be triggered by pausing whilst the video is still running its play promise. I'd hoped this was external as the component in this MR does have a pause function - this function however is not called, so it must be happening inside of the
plyr
orngx-plyr
component.Edited by Ben Hayward - Resolved by Ben Hayward
- Developer
We need to filter the sentry error. See the documentation here.
https://docs.sentry.io/error-reporting/configuration/filtering/?platform=javascript
Edited by Brian Hatchet - Developer
Check out the lines I've commented in
src/app/app.module.ts
(taking these out when ready) - Developer
Better yet, I've commented them out whilst changing something minor, but you can see the explanations below:
Note this is coded blind with no means of testing. I can only reproduce 1 of the issue, and I know that one is successfully filtered. Everything else is an educated guess wrapped in a try statement.
- Developer
Note this is entirely in a do not review or merge state.
added scoped label and automatically removed label
marked as a Work In Progress
changed the description
added scoped label and automatically removed label