Search Results

Search found 6 results on 1 pages for 'osmf'.

Page 1/1 | 1 

  • How can I scale an OSMF player in ActionScript 3/Flex

    - by Greg Hinch
    I am trying to create a simple video player SWF using the open source media framework in Flex 4. I want to make it dynamically scale based on the dimensions of the video, input by the user. I am following the directions on the Adobe help site, but the video does not seem to scale properly. Depending on the size, sometimes videos play larger than the space allotted on the webpage, and sometimes smaller. The only way I have been able to get it to work properly is by including a SWF metadata tag hardcoding the width and height, but I can't use that if I want to make the player dynamically sized. My code is : package { import flash.display.Sprite; import flash.events.Event; import org.osmf.media.MediaElement; import org.osmf.media.MediaPlayer; import org.osmf.media.URLResource; import org.osmf.containers.MediaContainer; import org.osmf.elements.VideoElement; import org.osmf.layout.LayoutMetadata; public class GalleryVideoPlayer extends Sprite { private var videoElement:VideoElement; private var mediaPlayer:MediaPlayer; private var mediaContainer:MediaContainer; private var flashVars:Object; public function GalleryVideoPlayer() { if (stage) init(); else addEventListener(Event.ADDED_TO_STAGE, init); } private function init(e:Event = null):void { removeEventListener(Event.ADDED_TO_STAGE, init); flashVars = loaderInfo.parameters; mediaPlayer = new MediaPlayer(); videoElement = new VideoElement(new URLResource(flashVars.file)); mediaContainer = new MediaContainer(); var layoutMetadata:LayoutMetadata = new LayoutMetadata(); layoutMetadata.width = Number(flashVars.width); layoutMetadata.height = Number(flashVars.height); videoElement.addMetadata(LayoutMetadata.LAYOUT_NAMESPACE, layoutMetadata); mediaPlayer.media = videoElement; mediaContainer.addMediaElement(videoElement); addChild(mediaContainer); } }}

    Read the article

  • OSMF seek with Amazon Cloudfront

    - by giorrrgio
    I've written a little OSMF player that streams via RTMP from Amazon Cloudfront. There's a known issue, the mp3 duration is not correctly readed from metadata and thus the seek function is not working. I know there's a workaround implying the use of getStreamLength function of NetConnection, which I successfully implemented in a previous non-OSMF player, but now I don't know how and when to call it, in terms of OSMF Events and Traits. This code is not working: protected function initApp():void { //the pointer to the media var resource:URLResource = new URLResource( STREAMING_PATH ); // Create a mediafactory instance mediaFactory = new DefaultMediaFactory(); //creates and sets the MediaElement (generic) with a resource and path element = mediaFactory.createMediaElement( resource ); var loadTrait:NetStreamLoadTrait = element.getTrait(MediaTraitType.LOAD) as NetStreamLoadTrait; loadTrait.addEventListener(LoaderEvent.LOAD_STATE_CHANGE, _onLoaded); player = new MediaPlayer( element ); //Marker 5: Add MediaPlayer listeners for media size and current time change player.addEventListener( DisplayObjectEvent.MEDIA_SIZE_CHANGE, _onSizeChange ); player.addEventListener( TimeEvent.CURRENT_TIME_CHANGE, _onProgress ); initControlBar(); } private function onGetStreamLength(result:Object):void { Alert.show("The stream length is " + result + " seconds"); duration = Number(result); } private function _onLoaded(e:LoaderEvent):void { if (e.newState == LoadState.READY) { var loadTrait:NetStreamLoadTrait = player.media.getTrait(MediaTraitType.LOAD) as NetStreamLoadTrait; if (loadTrait && loadTrait.netStream) { var responder:Responder = new Responder(onGetStreamLength); loadTrait.connection.call("getStreamLength", responder, STREAMING_PATH); } } }

    Read the article

  • OSMF - add an actionscript cuepoint to a video?

    - by redconservatory
    I'm trying to add a cuepoint to a video using OSMF. I built an OSMF video player, and I'd like to use this instead of the FLVPlayback component, which seems like the only way to add an actionscript cuepoint? Anyhow, I created a cuepoint by writing this: var cuePoint:CuePoint = new CuePoint(CuePointType.ACTIONSCRIPT, 1, "good point", null); videoElement.addEventListener(MediaElementEvent.METADATA_ADD, onMetadataAdd); trace(cuePoint.time); The cuepoint time traced out to "1" (successful). I then took this code from the documentation, thinking it would help trace the cuepoint when I published my movie (to test the video) private function onMetadataAdd(event:MediaElementEvent):void { if (event.namespaceURL == CuePoint.DYNAMIC_CUEPOINTS_NAMESPACE) { var timelineMetadata:TimelineMetadata = videoElement.getMetadata(CuePoint.DYNAMIC_CUEPOINTS_NAMESPACE) as TimelineMetadata; timelineMetadata.addEventListener(TimelineMetadataEvent.MARKER_TIME_REACHED, onCuePoint); } } private function onCuePoint(event:TimelineMetadataEvent):void { var cuePoint:CuePoint = event.marker as CuePoint; trace("Cue Point at " + cuePoint.time); } However, I don't get a trace message when the video hits 1 second. Can anyone help me?

    Read the article

  • bufferTime on OSMF

    - by Ronnie
    I am having an issue with OSMF. I have an MP4 that is 40MB. It is being progressively loaded. My issue is the video wont begin playing until the video has fully loaded. I am testing this on a web server. Any idea what's going on or what I am not doing? var mps:MediaPlayerSprite = new MediaPlayerSprite(); mps.x = 159; mps.y = 53; mps.width = 512; mps.height = 288; mps.resource = new URLResource("resources/video/3.4.1.mp4"); addChild(mps); I've even tried adding mps.mediaPlayer.bufferTime = 1; but no luck. I've even tried 0.

    Read the article

  • Adobe publie Open Source Media Framework 2.0 pour la création de contenus multimédias optimisés pour Flash

    Adobe publie Open Source Media Framework 2.0 pour la création de contenus multimédias optimisés pour Flash Adobe a annoncé la disponibilité de la version 2.0 d'Open Source Media Framework (OSMF), sa plateforme permettant la création de lecteurs multimédias optimisés pour Adobe Flash. OSMF met à la disposition des développeurs des outils pour proposer des expériences uniques en tirant parti de modules externes dédiés à la publicité, aux mesures de suivi et à la diffusion de contenu, ainsi que des fonctions de lecteurs vidéo standard telles que les commandes de lecture, la navigation vidéo, la mise en mémoire tampon et la diffusion dynamique en continu. La version 2.0 appo...

    Read the article

  • Could not resolve <fx:Script> to a component implementation.

    - by seref
    Hi, i created project with flexmojos maven archtype..i used flexmojos:flexbuilder and compile/run with FlashBuilder 4 everything is okay but when i try to compile project with flexmojos i got following error: [ERROR] Z:....\src\main\flex\Main.mxml:[6,-1] Could not resolve < fx:Script to a component implementation. [INFO] BUILD FAILURE my mxml: <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%" creationComplete="application1_creationCompleteHandler(event)"> <fx:Script> <![CDATA[ import mx.controls.Alert; import mx.events.FlexEvent; protected function application1_creationCompleteHandler(event:FlexEvent):void { Alert.show("success!!!!") } ]]></fx:Script> </s:Application> pom.xml like: ...... <packaging>swf</packaging> ...... <properties> <flex-sdk.version>4.1.0.16076</flex-sdk.version> <flexmojos.version>3.8</flexmojos.version> </properties> ...... <build> <sourceDirectory>src/main/flex</sourceDirectory> <testSourceDirectory>src/test/flex</testSourceDirectory> <plugins> <plugin> <groupId>org.sonatype.flexmojos</groupId> <artifactId>flexmojos-maven-plugin</artifactId> <version>${flexmojos.version}</version> <extensions>true</extensions> <dependencies> <dependency> <groupId>com.adobe.flex</groupId> <artifactId>compiler</artifactId> <version>${flex-sdk.version}</version> <type>pom</type> </dependency> </dependencies> <configuration> <compiledLocales> <locale>en_US</locale> </compiledLocales> <mergeResourceBundle>true</mergeResourceBundle> <accessible>true</accessible> <optimize>true</optimize> <targetPlayer>10.0.0</targetPlayer> <showWarnings>true</showWarnings> <linkReport>true</linkReport> </configuration> </plugin> </plugins> </build> <dependencies> <!-- Flex framework resource bundles --> <dependency> <groupId>com.adobe.flex.framework</groupId> <artifactId>flex-framework</artifactId> <version>${flex-sdk.version}</version> <type>pom</type> </dependency> <!-- Include unit test dependencies. --> <dependency> <groupId>com.adobe.flexunit</groupId> <artifactId>flexunit</artifactId> <version>4.0-rc-1</version> <type>swc</type> <scope>test</scope> </dependency> </dependencies> ....... maven output compiler config : INFO] Flex compiler configurations: -compiler.external-library-path C:\...\.m2\repository\com\adobe\flex \framework\playerglobal\4.1.0.16076\10.0\playerglobal.swc -compiler.include-libraries= -compiler.library-path C:\...\.m2\repository\com\adobe\flex\framework \datavisualization\4.1.0.16076\datavisualization-4.1.0.16076.swc C:\... \.m2\repository\com\adobe\flex\framework\flash-integration \4.1.0.16076\flash-integration-4.1.0.16076.swc C:\...\.m2\repository \com\adobe\flex\framework\flex\4.1.0.16076\flex-4.1.0.16076.swc C:\... \.m2\repository\com\adobe\flex\framework\framework \4.1.0.16076\framework-4.1.0.16076.swc C:\...\.m2\repository\com\adobe \flex\framework\osmf\4.1.0.16076\osmf-4.1.0.16076.swc C:\... \.m2\repository\com\adobe\flex\framework\rpc \4.1.0.16076\rpc-4.1.0.16076.swc C:\...\.m2\repository\com\adobe\flex \framework\spark\4.1.0.16076\spark-4.1.0.16076.swc C:\... \.m2\repository\com\adobe\flex\framework\sparkskins \4.1.0.16076\sparkskins-4.1.0.16076.swc C:\...\.m2\repository\com\adobe \flex\framework\textLayout\4.1.0.16076\textLayout-4.1.0.16076.swc C: \...\.m2\repository\com\adobe\flex\framework\utilities \4.1.0.16076\utilities-4.1.0.16076.swc C:\...\.m2\repository\com\adobe \flex\framework\datavisualization \4.1.0.16076\datavisualization-4.1.0.16076-en_US.rb.swc C:\... \.m2\repository\com\adobe\flex\framework\framework \4.1.0.16076\framework-4.1.0.16076-en_US.rb.swc C:\...\.m2\repository \com\adobe\flex\framework\osmf\4.1.0.16076\osmf-4.1.0.16076- en_US.rb.swc C:\...\.m2\repository\com\adobe\flex\framework\rpc \4.1.0.16076\rpc-4.1.0.16076-en_US.rb.swc C:\...\.m2\repository\com \adobe\flex\framework\spark\4.1.0.16076\spark-4.1.0.16076-en_US.rb.swc C:\...\.m2\repository\com\adobe\flex\framework\textLayout \4.1.0.16076\textLayout-4.1.0.16076-en_US.rb.swc C:\...\.m2\repository \com\adobe\flex\framework\flash-integration\4.1.0.16076\flash- integration-4.1.0.16076-en_US.rb.swc C:\...\.m2\repository\com\adobe \flex\framework\playerglobal\4.1.0.16076\playerglobal-4.1.0.16076- en_US.rb.swc -compiler.theme Z:\.....\target\classes\configs\themes\Spark \spark.css -compiler.accessible=true -compiler.allow-source-path-overlap=false -compiler.as3=true -compiler.debug=false -compiler.es=false -compiler.fonts.managers flash.fonts.JREFontManager flash.fonts.BatikFontManager flash.fonts.AFEFontManager flash.fonts.CFFFontManager -compiler.fonts.local-fonts-snapshot Z:\.....\target\classes \fonts.ser -compiler.keep-generated-actionscript=false -licenses.license flashbuilder4 952309948800588759250406 -licenses.license flexbuilder4.displayedStartPageAtLeastOneTime true -compiler.locale en_US -compiler.optimize=true -compiler.source-path Z:\.....\src\main\flex -compiler.strict=true -use-network=true -compiler.verbose-stacktraces=false -compiler.actionscript-file-encoding UTF-8 -target-player 10.0.0 -default-background-color 8821927 -default-frame-rate 24 -default-script-limits 1000 60 -default-size 500 375 -compiler.headless-server=false -compiler.keep-all-type-selectors=false -compiler.use-resource-bundle-metadata=true -metadata.date Fri Mar 04 14:04:37 EET 2011 -metadata.localized-title Main x-default -verify-digests=true -compiler.namespaces.namespace+=http://ns.adobe.com/mxml/2009,Z:\..... \target\classes\config-4.1.0.16076\mxml-2009-manifest.xml -compiler.namespaces.namespace+=library://ns.adobe.com/flex/spark,Z: \.....\target\classes\config-4.1.0.16076\spark-manifest.xml -compiler.namespaces.namespace+=library://ns.adobe.com/flex/mx,Z:\..... \target\classes\config-4.1.0.16076\mx-manifest.xml -compiler.namespaces.namespace+=http://www.adobe.com/2006/mxml,Z:\..... \PozitronUI\target\classes\config-4.1.0.16076\mxml-manifest.xml - static-link-runtime-shared-libraries=false -load-config= -metadata.language+=en_US any help... regards,

    Read the article

1