apod-api icon indicating copy to clipboard operation
apod-api copied to clipboard

Video embedded in a <video> HTML tag for customizing video player of the astronomy video of the day

Open ghost opened this issue 3 years ago • 3 comments

Since the video URL is a YouTube video i've to embed It using iframe. Is possibile to use <video> so can customize my video player?

Providers

  • YouTube
  • Vimeo

APIs

  • https://developers.google.com/youtube/player_parameters
  • https://developer.vimeo.com/player/sdk

See also

  • https://developer.mozilla.org/en-US/docs/Web/Guide/Audio_and_video_delivery/Video_player_styling_basics

ghost avatar May 04 '21 09:05 ghost

Since the video URL is a YouTube video i've to embed It using iframe.

here‘s what I do (PHP) to either embed YT or Vimeo players for media_type=video correctly; might be helpful to you: https://github.com/zorgch/zorg-code/blob/b4772a0611de37608927f77507c47259e06a28f3/www/includes/apod.inc.php#L172

oliveratgithub avatar Aug 15 '21 19:08 oliveratgithub

Good morning, I don't understand what the code does, could it link to a visitable version? In essence, does it recover the content of the iframe? Being my goal to style the player I could try to simply enrich YouTube URLs with these APIs. https://developers.google.com/youtube/player_parameters This is for YouTube. I do not exclude proposing an extension of these APIs to obtain enriched URLs. Alternatively, you could retrieve the HTML of the iframe, modify it and add it to the document via JavaScript if necessary. Thanks for the contribution.

ghost avatar Aug 16 '21 16:08 ghost

here‘s what I do (PHP) to either embed YT or Vimeo players for media_type=video correctly

Good morning, I don't understand what the code does, could it link to a visitable version? In essence, does it recover the content of the iframe?

@ghost Sure, here you go:

  • YouTube example: https://zorg.ch/gallery.php?show=pic&picID=16506
  • Vimeo example: https://zorg.ch/gallery.php?show=pic&picID=16395

oliveratgithub avatar Feb 01 '22 16:02 oliveratgithub