1

I like to add youtube video in videodisplay spark component. i tried this but cant work,

 <s:VideoDisplay id="myVid" autoPlay="true"
                 source="http://www.youtube.com/watch?v=LqNQV3tsX1"
                 height="300" width="400"                        
                     />

Is there any mistake in my code?

ketan
  • 19,129
  • 42
  • 60
  • 98

2 Answers2

1

you're pointing source to youtube website, not the video itself. You have to extract real video url first.

Flash
  • 466
  • 6
  • 16
  • its a real video url ' www.youtube.com/watch?v=LqNQV3tsX1Y ' – ketan Jun 25 '13 at 12:35
  • 1
    no it's not! It's a website with embed player. Real video url is hidden in flash action script. You have to extract it manually, or use tool for downloading youtube videos to get the REAL url. – Flash Jun 25 '13 at 12:47
  • 1
    @ketan that is not the right url. Take a look at the [getting started](https://developers.google.com/youtube/flash_api_reference#GettingStarted) guide, you need to load the "you tube player" (a flash SWF), then you write some code that instructs the you tube player to load a particular video. – Sunil D. Jun 25 '13 at 18:18
1

ok I Got the Answer, I use SWFLoader Instead of VideoDisplay.Here the Code. Here I use Same Youtube URL.

private var url:String = "http://www.youtube.com/v/LqNQV3tsX1Y";

<mx:SWFLoader id="swfLoader"
                  minHeight="390"
                  minWidth="640"
                  source="{url}"
                  bottom="1"
                  left="1"
                  right="1"
                  top="1"
                  autoLoad="true"
                  maintainAspectRatio="true"
                  scaleContent="false"/>

Thanks...

ketan
  • 19,129
  • 42
  • 60
  • 98