Read getting_started text version

OpenVideoPlayer

GettingStartedForAdobeFlashandAdobeFlexDevelopers

LastUpdate:3/11/0912:41PM

Overview

TheOpenVideoPlayer(OVP)codebaseforActionScript3.0enablesAdobeFlashandAdobeFlex developerstoquicklycreatemediaplayersforstreamingcontentfromAdobeFlashMediaServer(FMS), includingContentDeliveryNetworks(CDNs),orprogressivelydownloadedcontentoverHTTP. Foranexplanationofthedifferencesbetweenprogressivedownloadandstreaming,see"FlashVideo LearningGuide". WhyDoINeedThis? "AdobeFlashhastheFLVPlayback,MediaDisplay,MediaPlayer,andothercomponentsforplayingFlash VideowhileAdobeFlexBuildershipswiththeVideoDisplaycomponent,sowhydoIneedtheOVP classes?" TheOVPActionScript3classesremovesomeofthepainofdeliveringFlashVideoovertheInternetthat thecomponentsmentionedabovedonotnativelyaddress. Specifically,theOVPclassesprovide: 1. Arobustconnectionquickly.Youdon'tneedtoworryaboutdroppingbacktotunnelingover HTTPifyourusersarebehindacorporatefirewallandareunabletoconnecttoanFMSserver overRTMP.TheOVPConnectionclassreturnsaworkingconnectionquickly,tryingseveralports andprotocolsinanonlinearfashion. 2. Bandwidthmeasurement.Asimpleasynchronousmethodcallandacorrespondingeventgive youestimatedbandwidthforanFMSorCDNhostnameconnection.Forprogressivedownloads overHTTP,aclasscalledHTTPBandwidthEstimateisavailable. 3. AleanerSWFfile.SimplydraggingtheFLVPlaybackcomponentontoanemptystageinFlash CS4andcompilingcreatesa60KBSWFfile.ThebarebonesOVPsamplementionedinStep3 belowisonly12KB. 4. SomeeventsaremissingfromtheFlashPlayer.Currently,theFlashPlayerdoesnotdispatch pauseandresumeeventsforprogressivelydownloadedcontent.TheOvpNetStreamclasswill dispatchtheseeventsforprogressivecontentifyouaskitto. 5. Acompletedynamicstreaming(multibitrate)solution.TheOvpDynamicNetStreamclass providesaclientsidesolutiontothenewdynamicstreamingfeaturesofFMSforondemand streams. 6. ActionScript3classesimplementingclientsidelogicspecifictoCDNbehaviorandspecial features,suchasconnectionandstreamauthentication,connectingandplayinglivestreams,and theAkamaiRandomSeekTMservice,forexample. 7. MediaRSSparsers.ActionScript3classesthatcanloadaMediaRSSplaylistparseitandallow youtofiltertheresultsetwith"like"or"all"queries.AnActionScript3classthatcanloadand parseXMLmetafilesreturnedbyCDNspecificservicessuchasAkamai'sStreamOSservice.

Step1­GettheLatestRelease

Getthelatestreleasesasazipfilesfromsourceforge.net. Youcanfindthemhere:https://sourceforge.net/projects/openvideoplayer/

Step2­GetFamiliarwiththecodeandthedocumentation

UnzipthereleasefilesfromStep1onyourlocalfilesystem;youwillseethefollowingdirectory structure: /ovp /trunk /flash /core /bin /com /akamai /net /rss /docs /asdocs /org /openvideoplayer /cc /events /net /parsers /rss /utilities /players /samples The/coredirectory ThisdirectorycontainsthecoreOVPclasses.Theseclasseshandleconnectingto,andplayinglive, ondemand,andmultibitratestreams,closedcaptioningsupport,dynamiccuepoints,RSSparsing,utility classesandmore. Underthe/docs/asdocssubdirectoryyouwillfindthedocumentationgeneratedfromAdobe'sASDoc utility(formoreinformationonASDocclickhere).Tobeginperusingthecodedocumentationopenthe filecalledindex.htmlinthe/asdocssubdirectory.ThisdocumentationshowstheActionScriptclasses, theirproperties,methods,andevents. The/playersdirectory ThisdirectorycontainsanAkamaispecificmediaplayercapableofplayingeverytypeofliveand ondemandmediapossibleovertheAkamainetwork.SimplyloadtheFLAfileintoFlashCS4andhit Publish. The/samplesdirectory ThisdirectorycontainsbothFlashCS4andFlex3samplemediaplayersdemonstratingvariousaspectsof theOVPcorecodebase. TheFlashCS4sampleswillloadandcompileinFlashCS4only.SimplyloadtheFLAfilesintotheFlash authoringenvironmentandpublish(shiftF12).ThepublishsettingsforeachFLAfilecontainarelative pathtotheOVPSWCfile(staticlibrary).

FortheFlexsamples,openFlexBuilder3andselect"File>Import>FlexProject..."andbrowsetothe /samples/flexdirectory.ThisdirectorycontainsaFlexprojectthatincludesalloftheFlexsamplesasFlex applicationfiles(MXMLfiles).Torunasample,simplyrightclickandchoose"RunApplication".

Step3­UnderstandaverySimpleHTTPMediaPlayerinFlashCS4

Findthetwofiles"SimplePDL.fla"and"SimplePDL.as"inthe/samples/flashfoldermentionedabove. ThisFlashprojectanditscorrespondingActionScript3classareverybarebones,butdemonstratethe basicstepsneededtogetyouplayingmediaquicklyusingtheOVPcodebase. 1. Open"SimplePDL.fla"inAdobeFlashCS4. 2. ClickonthestageandnoticeinthepropertieswindowfortheFLAfilethe"Class:"fieldcontains "SimplePDL".Thecompilerwilllookforafilecalled"SimplePDL.as"andwithinthatfile,aclass called"SimplePDL". 3. FromtheFilemenu,openthe"SimplePDL.as"file. 4. Lookattheconstructor(themethodcalled"SimplePDL()"),noticewe"new"anOvpConnection objectandaddtheminimal,necessarylisteners.Nextwecallthe"connect"methodpassing"null" astheonlyargument,thisisconsistentwiththeAdobeNetConnectionclassforplaying progressivedownloadsoverHTTP. 5. Lookatthemethodcalled"netStatusHandler".ThismethodisourlistenerforNET_STATUSevents firedbytheOvpConnectionclasswe'veinstantiatedintheconstructor.Whenwereceiveastatus of"NetConnection.Connect.Success"wecallthe"connectedHandler"method. 6. Takealookatthe"connectedHandler"method.HereweinstantiateanOvpNetStreamobjectand giveittheOvpNetConnectionobject,addournecessaryeventlisteners,attachtheOvpNetStream objecttotheVideoobjectonthestage,andcallthe"play"method. FormorecomprehensiveexamplesoftheOVPcorecode,takealookattheotherFlashCS4andFlex samplesincludedinthe/samplesdirectory. [Endofdocument]

Information

getting_started

3 pages

Report File (DMCA)

Our content is added by our users. We aim to remove reported files within 1 working day. Please use this link to notify us:

Report this file as copyright or inappropriate

985167


Notice: fwrite(): send of 220 bytes failed with errno=104 Connection reset by peer in /home/readbag.com/web/sphinxapi.php on line 531