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

bug(Angular Youtube player: Cannot read properties of null (reading 'src') #29221

Open
1 task done
mattiLeBlanc opened this issue Jun 10, 2024 · 2 comments
Open
1 task done
Labels
area: youtube-player cannot reproduce The team is unable to reproduce this issue with the information provided P4 A relatively minor issue that is not relevant to core functions

Comments

@mattiLeBlanc
Copy link

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

17.0.9

Description

In our app, we can play YT music playlists. When we search for a keyword and get a couple of YT playlists as result, we can play the first result which opens the YT player. When I then search again and start the second search result, whilst the YT play er is still active, I change the playerVars with the new playlist ID.
The playlist will load but an error is thrown in the console
which is being picked up by my app error handler.

I have to be able to load a different video in the videoplayer, and the video player Angular component will not always be destroyed.

Reproduction

In our app, we can play YT music playlists. When we search for a keyword and get a couple of YT playlists as result, we can play the first result which opens the YT player. When I then search again and start the second search result, whilst the YT play er is still active, I change the playerVars with the new playlist ID.
The playlist will load but an error is thrown in the console:

TypeError: Cannot read properties of null (reading 'src')
    at r.sendMessage (www-widgetapi.js:253:96)
    at Jc (www-widgetapi.js:243:100)
    at <computed>.c.<computed> [as pauseVideo] (www-widgetapi.js:258:135)
    at a.pauseVideo (youtube-player.mjs:201:22)
    at Object.next (youtube-player.component.ts:82:20)
    at o.subscribe.a (tap.js:17:71)
    at Is._next (OperatorSubscriber.js:12:9)
    at Is.next (Subscriber.js:29:12)
    at filter.js:6:122
    at Is._next (OperatorSubscriber.js:12:9)

whichi is being picked up by my app error handler.

Expected Behavior

No error when I change the youtube playlist id.
I

Actual Behavior

JS error thrown

In our app, we can play YT music playlists. When we search for a keyword and get a couple of YT playlists as result, we can play the first result which opens the YT player. When I then search again and start the second search result, whilst the YT play er is still active, I change the playerVars with the new playlist ID.
The playlist will load but an error is thrown in the console:

TypeError: Cannot read properties of null (reading 'src')
at r.sendMessage (www-widgetapi.js:253:96)
at Jc (www-widgetapi.js:243:100)
at .c. [as pauseVideo] (www-widgetapi.js:258:135)
at a.pauseVideo (youtube-player.mjs:201:22)
at Object.next (youtube-player.component.ts:82:20)
at o.subscribe.a (tap.js:17:71)
at Is._next (OperatorSubscriber.js:12:9)
at Is.next (Subscriber.js:29:12)
at filter.js:6:122
at Is._next (OperatorSubscriber.js:12:9)



### Environment

Angular: 18
CDK/Material: 18
Browser(s): 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36`
Operating System (e.g. Windows, macOS, Ubuntu): MacOS / Chrome
@mattiLeBlanc mattiLeBlanc added the needs triage This issue needs to be triaged by the team label Jun 10, 2024
@andrewseguin
Copy link
Contributor

Without a link to reproduce this, it's going to be very unlikely that we can diagnose the issue

@andrewseguin andrewseguin added cannot reproduce The team is unable to reproduce this issue with the information provided P4 A relatively minor issue that is not relevant to core functions area: youtube-player and removed needs triage This issue needs to be triaged by the team labels Jun 24, 2024
@mattiLeBlanc
Copy link
Author

@andrewseguin I can try to if I can reproduce it in stackblitz. I think it is a race condition issue.
My app error handler is greedy and caught the error whilst the youtube playlist was playing fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: youtube-player cannot reproduce The team is unable to reproduce this issue with the information provided P4 A relatively minor issue that is not relevant to core functions
Projects
None yet
Development

No branches or pull requests

2 participants