[ https://issues.apache.org/jira/browse/FLEX-33926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13839217#comment-13839217 ]
OmPrakash Muppirala commented on FLEX-33926: -------------------------------------------- The new APIs in OSMF 2.0 has moved things around a bit. In OSMF 1.x MediaPlayer.videoObject returned a Video object. So, calling spark.components.VideoDisplay.videoObject() used to return a Video object to which we could attach a camera. In OSMF 2.0, MediaPlayer.videObject returns a VideoSurface object which has a internal Video object. Making this a public property, I was able to fix this bug: Now, spark.components.VideoDisplay.videoObject() should look like this: public function get videoObject():Video { var videoSurface:VideoSurface = videoPlayer.displayObject as VideoSurface; return videoSurface.video; } Unfortunately, to make this work, OSMF team needs to make the video object in VideoSurface public. I have created a ticket for this in OSMF bugbase https://bugbase.adobe.com/index.cfm?event=bug&id=3679507 Please vote on that ticket to have it resolved. Once that is done, we can fix the Apache Flex codebase. > Null error in videoDisplay.videoObject while using VideoDisplay > --------------------------------------------------------------- > > Key: FLEX-33926 > URL: https://issues.apache.org/jira/browse/FLEX-33926 > Project: Apache Flex > Issue Type: Bug > Components: Spark: VideoPlayer > Affects Versions: Apache Flex 4.11.0 > Reporter: João Saleiro > Assignee: OmPrakash Muppirala > Labels: video > > The videoDisplay.videoObject in the example below is null, so a null object > reference is thrown. > Using the Webcam with Spark VideoDisplay in Flex 4.11 does not work. > <?xml version="1.0" encoding="utf-8"?> > <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" > xmlns:s="library://ns.adobe.com/flex/spark" > xmlns:mx="library://ns.adobe.com/flex/mx"> > <fx:Script> > <![CDATA[ > import org.osmf.net.StreamType; > protected function video_d_creationCompleteHandler():void > { > var camera:Camera = Camera.getCamera(); > if (camera) > video_d.videoObject.attachCamera(camera); > } > ]]> > </fx:Script> > <s:VideoDisplay id="video_d" > x="15" y="23" > creationComplete="video_d_creationCompleteHandler()"> > <s:source> > <s:DynamicStreamingVideoSource host="" > streamType="{StreamType.LIVE}"> > <s:DynamicStreamingVideoItem/> > </s:DynamicStreamingVideoSource> > </s:source> > </s:VideoDisplay> > </s:WindowedApplication> -- This message was sent by Atlassian JIRA (v6.1#6144)