nasa / apod-api

Astronomy Picture of the Day API service
Apache License 2.0
812 stars 155 forks source link

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

Open ghost opened 3 years ago

ghost commented 3 years ago

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

APIs

See also

oliveratgithub commented 3 years ago

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

ghost commented 3 years ago

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.

oliveratgithub commented 2 years ago

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: