angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.37k stars 6.75k forks source link

feat(youtube-player): Support looping of video #27530

Open drullo opened 1 year ago

drullo commented 1 year ago

Feature Description

Provide a property that allows looping to be enabled so that the video is automatically restarted upon completion. Currently, this has to be accomplished by monitoring for stateChange, then manually calling playVideo() once getPlayerState() reports 0 (zero).

Incidentally, this has to be done using the native object (passed via $event) - it does not work if trying to call playVideo() from a reference to the YouTubePlayer object obtained via ViewChild() for some reason. The object is present and properties seem to be available. But calling playVideo() on that object doesn't work. I have to call it on $event.target.

Use Case

No response

jamesikanos commented 1 year ago

Can this be achieved by setting the loop paramter of playerVars to True and setting the list to the video id and the list type to playlist?

https://developers.google.com/youtube/player_parameters#loop