Determining the Width and Height of a YouTube video embedded with an Object tag


  • I am embedding several YouTube videos in my ASP.NET pages using html similar to the following:

    <object type="application/x-shockwave-flash" width="" height="" data="">
     <param name="movie" value=""/>

    I have values for the data and value attributes, and it works when I put values in for the width and height attributes, but I am not sure what the width and height attributes should be. First of all, is there a way for me to get them (or at least the ratio) from YouTube? Second, what should I do as far as adjusting the values for the controls? I am new to displaying videos on my page, so any help would be appreciated. Thanks.

    Nathan Sokalski

    Wednesday, November 06, 2013 11:20 PM


  • Hi,

    I thinks you can set the height and width according to your whole layout of the page and setting "allowFullScreen". In addition, you can refer the information

    #Try wmode=transparent, the whitespace of the flash object will turn transparent

    #Specifying the hex value of the background color will fill the undefined space with the value chosen

    Hope it can help you.

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Pengzhen Song Wednesday, November 13, 2013 11:19 AM
    Friday, November 08, 2013 2:05 AM