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

[Question] Change video id #23

Closed
guillermo7227 opened this issue Nov 29, 2019 · 5 comments
Closed

[Question] Change video id #23

guillermo7227 opened this issue Nov 29, 2019 · 5 comments

Comments

@guillermo7227
Copy link

Can I change the video id and make it play the new video after rendered?

@Garbee
Copy link
Contributor

Garbee commented Dec 11, 2019

Not currently. I have PR #28 open which is a basic first-pass at allowing for this to work.

@paulirish
Copy link
Owner

@guillermo7227 i know it's been a while.. but i'm interested in understanding this usecase a little more..

presumably you have something like a ... social video/music jukebox.. and new videos play often.. so you'd want to change the video id from script?

it seems like you'd also need to know when the current video finished.. right?

is there another usecase i'm not considering?

@Garbee
Copy link
Contributor

Garbee commented Oct 24, 2020

There could also be the case of say a video course. A list of available videos would show somewhere on the page. When one that isn't active is selected, it updates the same video embed to change the video stream rather than destroying and creating a new node.

@RentecErich
Copy link

RentecErich commented Jan 19, 2022

In case anyone needs to know this, as a work around, you can remove the lite-youtube element and create another one in its place with the new videoid to get this to work. I tried updating the attr using setAttribute and then using the attributeChangedCallback in the class, but couldnt get it to work. But the above work around got me where I needed to be.

@paulirish
Copy link
Owner

Yeah I prefer you just make a new one, like what @RentecErich suggests.

Early on we had a version which reacted to changing attributes, but it gets complicated. For now, this is out of scope for this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants