I have been advised to post this problem here from the AS3 Forum as it is to do with OSMF but I think my problem is in the AS3 code. I have created a DefaultMediaFactory element and added it to the stage but it is not showing. I am using three classes Main, LoadTextVariables and finaly the PayVideo class. I first set the stage width and height in a Main Class then call a LoadTextVariables class which gets the name of the video to play from an external text file. On loading the variables is complete it calls a PlayVideo class which creates the DefaultMediaFactory and loads the chosen video and displays it. All this works well except I can't see the video. I can hear the audio so I know it is playing. There are no other objects on the stage to hide anything. This is the code for creating the DefaultMediaFactory in the PlayVideo class:
package
{
import flash.display.Sprite;
/*import flash.display.StageAlign;
import flash.display.StageScaleMode;*/
import org.osmf.containers.MediaContainer;
import org.osmf.elements.VideoElement;
import org.osmf.layout.LayoutMetadata;
import org.osmf.media.DefaultMediaFactory;
import org.osmf.media.MediaElement;
import org.osmf.media.MediaFactory;
import org.osmf.media.MediaPlayer;
import org.osmf.media.MediaPlayerSprite;
import org.osmf.media.URLResource;
public class PlayVideo extends Sprite
{
public var videoToPlay:String;
private var _layout:LayoutMetadata;
private var _mediaContainer:MediaContainer;
private var _mediaElement:MediaElement;
private var _mediaFactory:MediaFactory;
private var _mediaPlayer:MediaPlayer;
public var isOK:Boolean=false;
public function PlayVideo(video:String)
{
videoToPlay=video;
trace("got to PlayVideo",videoToPlay);
playVid();
}
public function playVid():void{
trace("got to playVid",videoToPlay);
_mediaPlayer = new MediaPlayer();
_mediaPlayer.autoRewind = false ;
// Assign the resource to play. DefaultMediaFactory generates the appropriate
// MediaElement and passes it to the MediaPlayer.
_mediaFactory=new DefaultMediaFactory();
_layout = new LayoutMetadata();
_layout.width=stage.stageWidth;
_layout.height=stage.stageHeight;
_layout.x=0
_layout.y=0
_mediaContainer = new MediaContainer();
addChild(_mediaContainer);
_mediaElement = _mediaFactory.createMediaElement(new URLResource(videoToPlay));
_mediaElement.addMetadata(LayoutMetadata.LAYOUT_NAMESPACE, _layout);
_mediaPlayer.media = _mediaElement;
_mediaContainer.addMediaElement(_mediaElement);
trace("I am now playing the video= ",videoToPlay);
}
}
}
Any help with this would be appreciated.
Can you explain? I am using the latest OSMF.swc from http://www.opensourcemediaframework.com/
I have just been looking at http://blogs.adobe.com/osmf/ and this makes no sense to me at all. I am not publishing to HTML only .exe but I have not got that far yet. I am only trying to test the movie in Flash. Oh!(exasperated) I thought OSMF was supposed to be an easy way to create video. Any help is apreciated.
Now you are probably eager to test the performance of your video player with the exploratory implementation of Stage Video support in OSMF.
For this you’ll need to get the Flex SDK that contains the latest Stage Video APIs, you’ll need our source, and you’ll need to set up your development environment.
swfobject.embedSWF(
“StrobeMediaPlayback.swf”
, “StrobeMediaPlayback”
, 640
, 480
, “10.1.0″
, “expressInstall.swf”
, parameters
, {
allowFullScreen: “true”,
wmode: “direct”
},
,{
name: “StrobeMediaPlayback”
}
);
At this point you are ready to run your video player.
Normally, your video player should behave exactly as it did before switching to the exploratory version of OSMF.
If you can hear audio, but are not seeing the video, you've come to the right place. Please respond below with the following information...the more info you provide us the sooner we can help you:
1) What do you see: (a black box, white box, a green line, weird colors -- please be specific)
2) Your Operating System (Mac OSX, Windows 7, Windows XP, etc)
3) Internet Browser and version (Safari, Chome 7, Internet Explorer 7, Opera, etc)
4) Video Card if you know it
5) Adobe Flash version if you know it
As a temporary workaround, you can try one, or both, of the following:
1) Right click on the player > click Settings > Disable Hardware Acceleration > Refresh your Internet Browser
2) Try closing your browser and re-load the video.
Hi Ciciliu, we are also facing same problem and details are below
1) What do you see: (a black box, white box, a green line, weird colors -- please be specific) - a black box
2) Your Operating System (Mac OSX, Windows 7, Windows XP, etc) - Windows 7
3) Internet Browser and version (Safari, Chome 7, Internet Explorer 7, Opera, etc) - IE 9
4) Video Card if you know it - no idea
5) Adobe Flash version if you know it - Adobe flash builder 4.5, player 10.3.181.34...
Please help us.
North America
Europe, Middle East and Africa
Asia Pacific