Skip to content

bug(Youtube player): invalid video id error for youtube playlist #31396

Closed
@mattiLeBlanc

Description

@mattiLeBlanc

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

Not sure

Description

We are loading either youtube video (via videoId) or youtube playlist (via playervars list).
Since recently (one week ago) we are getting errors like:

Invalid video idError: Invalid video id
    at Gb (https://www.youtube.com/s/player/9fe2e06e/www-widgetapi.vflset/www-widgetapi.js:196:148)

on some devices loading a youtube playlist.
Strangely, I can watch the playlist fine, but my colleague running an older macbook with same Chrome browser cant and it triggers that error.
When my colleague goes to the iframe link directly:
https://www.youtube.com/embed/null?list=OLAK5uy_nTomD0YKdOKGu-LTFeKx0NA4bKgaeX-To&loop=1&listType=playlist&enablejsapi=1&widgetid=1&aoriginsup=1&vf=6 it does work.
The null value in the link, which probably is where a videoId normally sits is null, but that seems to be ignored by Youtube.

I am unclear what causes this issues and as far as I know, when loading a playlist, I only provide the list id.
The Docs clearly state:
Note: If you specify values for the list and listType parameters, the IFrame embed URL does not need to specify a video ID.

So, videoId doesn't seem to be required when loading a playlist. And it used to work.
So what is going on for some users that I am getting an Invalid Video ID?

Reproduction

Not possible to reproduce easily.
On my colleagues computer, inspecting the youtube player her iframe looks like:

<iframe frameborder=“0” allowfullscreen=“” allow=“accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share” referrerpolicy=“strict-origin-when-cross-origin” title=“YouTube video player” width=“747" height=“420” data-gtm-yt-inspected-98279342_13=“true” data-gtm-yt-inspected-98279342_23=“true” data-gtm-yt-inspected-98279342_25=“true” data-gtm-yt-inspected-98279342_157=“true”></iframe>

and there is a js error Error: Invalid video id at Gb (https://www.youtube.com/s/player/9fe2e06e/www-widgetapi.vflset/www-widgetapi.js:196:148) thrown.

For me, the iframe looks like:

<iframe frameborder="0" allowfullscreen="" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" title="Bosnia &amp; Herzegovina  Cultural inclusion Resource" width="747" height="420" src="[https://www.youtube.com/embed/null?list=PLbPc-CDfNeBWpqQQLmEJVMOdZWlCY6bTg&amp;loop=1&amp;listType=playlist&amp;enablejsapi=1&amp;aoriginsup=1&amp;vf=1](https://www.youtube.com/embed/null?list=PLbPc-CDfNeBWpqQQLmEJVMOdZWlCY6bTg&loop=1&listType=playlist&enablejsapi=1&origin=https%3A%2F%2Fapp.resparke.com&widgetid=1&aoriginsup=1&vf=1)" id="widget2" data-gtm-yt-inspected-98279342_13="true" data-gtm-yt-inspected-98279342_23="true" data-gtm-yt-inspected-98279342_25="true" data-gtm-yt-inspected-98279342_157="true"></iframe>

Expected Behavior

Load playlist normally

Actual Behavior

Invalid video idError: Invalid video id
at Gb (https://www.youtube.com/s/player/9fe2e06e/www-widgetapi.vflset/www-widgetapi.js:196:148)

when loading a playlist via playervars list argument and keeping videoId empty.

Environment

  • Angular : 19
  • CDK/Material: 19
  • Browser(s): Chrome 137, Safari Lastest macos, safari IOS
  • Operating System (e.g. Windows, macOS, Ubuntu): macos

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: youtube-player

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions