0

How can I get the correct format of an iframe embedded Youtube video using jQuery?

I need to know if the video is originally (at Youtube) in 3:4 format or 9:16 format or something else.

And I need this in order to remove some black bars from the top and bottom (from my question: Show Youtube video and thumbnail in correct 9:16 format) that are added to the video and its thumbnail. If I can find the correct format, I might be able to hide these bars by adjusting the height.

Update

I use the plugin prettyPhoto for jQuery to play a youtube video by simply having the URL. This is the driving code:

$(document).ready(function(){

  /*Youtube videos*/
  $("a[rel^='prettyPhoto']").prettyPhoto({
    animation_speed: 'fast',
    slideshow: 8000,
    hideflash: true,
    show_title: false,
    changepicturecallback: function(){
      /*At video start do some stuff*/          
    },
    social_tools: false
  });

});     

That means, I don't myself add and create the video iframe for the youtube film. I don't have much experience with Youtube's API. Is there a straight ahead way to find the original video ratios?

Community
  • 1
  • 1
Steeven
  • 4,057
  • 8
  • 38
  • 68
  • show us your current codes, especially in YouTube API codes . – Raptor Apr 02 '13 at 07:36
  • possible duplicate of [How to get YouTube video aspect ratio](http://stackoverflow.com/questions/5010495/how-to-get-youtube-video-aspect-ratio) – mplungjan Apr 02 '13 at 07:38
  • Thanks for the link, but I find my question a bit different; please wait with closing the question. I tried the best answer to that question you are linking to mplungjan, and it didn't work - please see my comment to that answer. He does though also mention the API, but I'm not sure how to use the API in my situation. @ShivanRaptor, see my update above. How can I use the API method here? – Steeven Apr 02 '13 at 10:12
  • Please see my new response at http://stackoverflow.com/questions/5010495/how-to-get-youtube-video-aspect-ratio/15908280#15908280 – Jeff Posnick Apr 09 '13 at 17:16
  • Thanks. I will close the question - the answer is on that other page – Steeven Apr 10 '13 at 21:39
  • Possible duplicate of [How do I get a YouTube video thumbnail from the YouTube API?](https://stackoverflow.com/questions/2068344/how-do-i-get-a-youtube-video-thumbnail-from-the-youtube-api) – Steeven Sep 21 '17 at 07:45

0 Answers0