Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • Sign in / Register
Minds Frontend
Minds Frontend
  • Project overview
  • Repository
  • Issues 350
  • Merge Requests 56
  • CI / CD
  • Security & Compliance
  • Packages
  • Wiki
  • Snippets
  • Members
  • Collapse sidebar
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Minds
  • Minds FrontendMinds Frontend
  • Merge Requests
  • !712

Open
Opened 20 hours ago by Ben Hayward@benhayward.ben
Report abuse

Plyr play error

  • Overview 5
  • Commits 1
  • Pipelines 1
  • Changes 1
0/2 threads resolved

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.

Request to merge fix/autoplay-bug-2377 into master
The source branch is 4 commits behind the target branch
Open in Web IDE
Pipeline #107363021 passed with warnings for 5a8c9b58 on fix/autoplay-bug-2377
              Requires 3 more approvals from Devs, Deployers, and QA.
              Guy Thouret
              Guy Thouret
              Olivia Madrid
              Olivia Madrid
              Mark Harding
              Mark Harding
              Xander Miller
              Xander Miller
              Juan Manuel Solaro
              Juan Manuel Solaro
              Ready to be merged automatically. Ask someone with write access to this repository to merge this request

              Closes #2377

              • Ben Hayward @benhayward.ben added Squad::Yellow Status::BuddyReview scoped labels 20 hours ago

                added scoped labels

              • Ben Hayward
                Ben Hayward @benhayward.ben · 19 hours ago
                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.

              • Ben Hayward
                Ben Hayward @benhayward.ben · 19 hours ago
                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 or ngx-plyr component.

                Edited by Ben Hayward 19 hours ago
              • Brian Hatchet
                Brian Hatchet :speech_balloon: @brianhatchet started a thread on the diff 1 hour ago
                Last updated by Ben Hayward 7 minutes ago
                src/app/modules/media/components/video-player/player.component.ts
                76 76
                77 77 @Input('autoplay')
                78 78 set autoplay(autoplay: boolean) {
                79 this.options.autoplay = autoplay;
                79 setTimeout(() => {
                • Brian Hatchet
                  Brian Hatchet :speech_balloon: @brianhatchet · 1 hour ago
                  Developer

                  Cant this be set in ngInit or ngAfterViewInit?

                • Ben Hayward
                  Ben Hayward @benhayward.ben · 7 minutes ago
                  Developer

                  Could maybe use the @input() to set a local variable _autoplay then check it in afterViewInit if(_autoplay) plyr.options.autoplay = _autoplay and change the option for autoplay if necessary.

                  Feels uglier but if you're worried about the timeouts its a route we can take.

                • Please register or sign in to reply
                • Brian Hatchet
                  Brian Hatchet :speech_balloon: @brianhatchet · 1 hour ago
                  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 1 hour ago
                • Please register or sign in to reply
              Please register or sign in to reply
              0 Assignees
              None
              None
              Milestone
              None
              Time tracking
              No estimate or time spent
              2
              Labels
              Squad::Yellow Status::BuddyReview
              Lock merge request
              Unlocked
              11
              11 participants
              user avatar
              Guy Thouret
              user avatar
              Olivia Madrid
              user avatar
              Mark Harding
              user avatar
              Xander Miller
              user avatar
              Juan Manuel Solaro
              user avatar
              Marcelo Rivera
              user avatar
              Brian Hatchet
              Reference: minds/front!712

              Now you can access the merge request navigation tabs at the top, where they’re easier to find.

              More information and share feedback