private function configureListeners(stream:URLStream):void { var _date:Date = new Date(); var _fileName:String = String(_date.milliseconds)+".flv"; stream.addEventListener(Event.COMPLETE, function(event:Event):void { var fileData:ByteArray = new ByteArray(); stream.readBytes(fileData,0,stream.bytesAvailable); var file:File = File.documentsDirectory.resolvePath(_fileName); var fileStream:FileStream = new FileStream(); fileStream.open(file, FileMode.WRITE); fileStream.writeBytes(fileData,0,fileData.length); fileStream.close(); }); downloadProgress.source = stream; //downloadProgress is ProgressBar id } public static const GET_VIDEO_INFO :String = "http://youtube.com/get_video_info.php"; public function downloadVideo(_youtubeId:String):void{ var service :HTTPService = new HTTPService(); service.url = GET_VIDEO_INFO + "?video_id=" + _youtubeId; service.resultFormat = 'object'; service.addEventListener(ResultEvent.RESULT, function(evt:ResultEvent):void{ var request:URLRequest = new URLRequest(unescape(evt.result.toString()).split("|")[1]); var stream:URLStream = new URLStream; configureListeners(stream); try { stream.load(request); } catch (error:Error) { trace("Unable to load requested URL."); } }); service.send(); }
Yeah, that is a short codes, for advance application you can use as3youtubelib to search, subscribe and comment the video. I have used oauth google and youtube API for multiple uploads to youtube. And once again no webservice unless google data protocol. i use pinless oauth. Please read the previous article. Thank you.
5 Response to "Download Youtube Video Using ActionScript or Air"
Lately already have a site made a script
http://www.download-youtube.us/
Actionscript is not javascript, but your link is rock man.. thanks.
This script is not longer working, i will update newest script
HOW I GET A LEGIT LOAN @ 2% INTEREST RATE
I am a mum of three little kids. When i could not face my Debt any more, my son was on hospital bed for surgery that involve huge money and i also needed some money to refinance and get a good home then i have to seeks for Assistance from friends and when there was no hope any more i decide to go online to seek a loan and i find MARIA HAUSTIN Loan company (mariahaustin@hotmail.com) with 2% interest Rate and applied immediately with my details as directed. Within seven Days of my application She wired my loan amount with No hidden charges and i could take care of my son medical bills, Renew my rent bill and pay off my debt. I will advice every loan seeker to contact MARIA HAUSTIN Company with mariahaustin@hotmail.com For easy and safe transaction.
*Full Name:_________
*Address:_________
*Tell:_________
*loan amount:_________
*Loan duration:_________
*Country:_________
*Purpose of loan:_________
*Monthly Income:__________
*Occupation__________
*Next of kins :_________
*Email :_________
Contact her company Via Email: mariahaustin@hotmail.com
My names are Jessica Switch from united states. Merry Christmas in advance friends, become rich today and take the risk of transforming your own life. Try and get a blank ATM card today from (MR TOM HOOPER) and be among the lucky ones who are benefiting from this cards. This PROGRAMMED blank ATM card is capable of hacking into any ATM machine, anywhere in the world. I got to know about this BLANK ATM CARD when I was searching for job online about a month ago.. It has really changed my life for good and now I can say I'm rich because am a living testimony. The least money I get in a day with this card is about $4,000. Every now and then I keeping pumping money into my account. Though is illegal, there is no risk of being caught, because it has been programmed in such a way that it is not traceable, it also has a technique that makes it impossible for the CCTV to detect you.. For details on how to get yours today, E-mail the hackers on ( Tomhooperhackersworld@yahoo.com ).
Post a Comment