brandly / brandly/angular-youtube-embed

Use existing player on video change

Open
#46 11 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
HTML
Stars
505
Forks
145
PR merge metrics
No merged PRs in 30d

Description

You're currently destroying the player and calling createPlayer every time the video id (or url/play list) is being changed. I think YouTube just updated their API's to stop this as my site started breaking.

Not sure if there are other use cases that might break this, but my current work around is to modify your loadPlayer function to check if the player exists, and instead of creating a new one, use player.loadVideoById to update the id. There are similar calls for load by url and for playlists.

src: https://developers.google.com/youtube/iframe_api_reference#loadVideoById

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the loadPlayer function mentioned in the issue and review how video IDs, URLs, and playlists currently trigger player creation. Read the YouTube IFrame API loadVideoById documentation and its corresponding URL and playlist loading calls; done means existing players update media without being destroyed and recreated when the video changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.