tags:

views:

334

answers:

2

hi, i'm trying to get youtube content into an flex 3 air application and have tried a number of options using tubeloc, wrapper as3 classes which all seem to not work. most recently, i've been trying the method in this link http://www.blackcj.com/blog/tag/youtube/ but still having difficulties with the code not able to find ytplayer in the test.html. Have been wracking the brains trying to figure out where it should go but no luck.

Also tried to use a swfloader component also, but no luck with it either... basically been trying to use it like so:

<mx:SWFLoader id="player2" source="http://www.youtube.com/swf/l.swf?video_id=xx" autoLoad="true" showBusyCursor="true" width="346" height="194" x="20" y="35"/>

but no luck with that either.

does anyone have any articles or clear steps I can follow to try and get this working? thanks.

A: 

well, it seems that loading up the embedded youtube player via html just won't work in my air application as the main application configuration has transparency enabled. This is a big in the air framework see here and its just not going to work. Apparently a HTMLOverlay can be used to position a window on top of your application, but this smells like a fairly nasty hack to me.

Kieran H
+1  A: 

I was using tubeloc to play YouTube video inside my Adobe Air application but it has some bugs which made me look for alternatives, which led me to your question and the link you suggested.

It has served me perfectly well. It's a lot simpler, specially if all you need is to play a video (or some videos).

About your issue:

but still having difficulties with the code not able to find ytplayer in the test.html. Have been wracking the brains trying to figure out where it should go but no luck.

It has happened to me whenever I had something wrong inside the HTML file. Make sure that the JavaScript synthax inside is correct and that the HTML itself is well formed.

Also, if you're importing those classes inside your project, don't forget that js folder. I did, and that was a reason for the same error.

If you need more than just play/pause a video, you can extend it's funcionality by taking a look at the YouTube API itself. It's quite simple, actually.

Anyways, thanks for providing that link and I hope you get it to work too. :)

leolobato

related questions