fossasia / eventyay-video

https://video-dev.eventyay.com
Apache License 2.0
1.49k stars 23 forks source link

Add support for Youtube embedding options #170

Open mariobehling opened 3 months ago

mariobehling commented 3 months ago

Add support for Youtube embedding options as switch boxes below the YouTube Video ID form field.

Screenshot from 2024-07-24 15-06-08

Add the following options:

<iframe width="560" height="315" src="https://www.youtube.com/embed/VIDEO_ID?modestbranding=1" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

You can also use YouTube's nocookie domain to enhance privacy and still use the modestbranding parameter to remove the logo:

<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/VIDEO_ID?modestbranding=1" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

To further customize the embed, you add the option for the following parameters:

Example with additional parameters:

<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/VIDEO_ID?modestbranding=1&controls=0&rel=0" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Example Embed Code

<iframe width="560" height="315" src="https://www.youtube.com/embed/VIDEO_ID?autoplay=1&loop=1&playlist=VIDEO_ID" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Example with Additional Parameters

<iframe width="560" height="315" src="https://www.youtube.com/embed/dQw4w9WgXcQ?autoplay=1&loop=1&playlist=dQw4w9WgXcQ&controls=0&mute=1" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
mariobehling commented 2 months ago

Please also implement the switch buttons.

mariobehling commented 2 months ago

Hi @untari

  1. Enabling "Autostart" results in the video starting from the beginning of the livestream instead of showing the video at the actual live time. Compare: https://video-dev.eventyay.com/rooms/77b6e3b4-2380-41a7-bb50-1732c998425d/ Screenshot from 2024-08-05 00-35-58

  2. It also does not do what it is supposed to do: The stream does not start automatically. Is the reason that there is a conflict with the profile option? There is an option to start livestreams automatically, but it also does not work with actual livestreams (only works with recorded videos). Compare: https://wikimania-live.eventyay.com/preferences

Screenshot from 2024-08-05 00-39-48

untari commented 2 months ago

@mariobehling I will look into whether there's a conflict with the profile option or another cause. We'll work on fixing this