How to play a emded video using OSMF?

Hi all,
I want to play a emded video using OSMF, the as3 class would be something like this :(of course it does not work)
[SWF(width = "356", height = "356", backgroundColor = "0x000000", frameRate = "12")]
    public class VideoPlayer4 extends Sprite {
        [Embed(source = '../../../../assets/video/TRAILOR 1280x720.mp4', mimeType = 'application/octet-stream')]
        public var vClass : Class;
        public function VideoPlayer4() {
            var mediaFactory:MediaFactory = new DefaultMediaFactory();
            var mediaElement:MediaElement = mediaFactory.createMediaElement(new vClass());
            mediaPlayer = new MediaPlayer();
            mediaPlayer.media = mediaElement;
            var mediaContainer:MediaContainer = new MediaContainer();
            mediaContainer.addMediaElement(mediaElement);
            mediaContainer.width = 356;
            mediaContainer.height = 356;
            addChild(mediaContainer);
I have no idea how to do that, please give me some advice.
Thanks!!

Hi guys, good news!!
I found a way to play embed flv using Flash Player 10.1, come & try yourself!!
package
    import flash.display.Bitmap;
    import flash.display.Sprite;
    import flash.events.*;
    import flash.media.Video;
    import flash.net.NetConnection;
    import flash.net.NetStream;
    import flash.text.TextField;
    import flash.utils.ByteArray;
    public class VideoPlayer6 extends Sprite
       [Embed(source='../../../../assets/video/video.flv', mimeType='application/octet-stream')]
       private var flvClass:Class;
       private var flvData:ByteArray = new flvClass();
       private var connection:NetConnection;
       private var stream:NetStream;
       private var video:Video;
       public function VideoPlayer6()
          connection = new NetConnection();
          connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
          connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
          connection.connect(null);
       private function netStatusHandler(event:NetStatusEvent):void {
          switch (event.info.code) {
             case "NetConnection.Connect.Success":
                connectStream();
                break;
             case "NetStream.Play.StreamNotFound":
                trace("NetStream.Play.StreamNotFound");
                break;
       private function connectStream():void {
          stream = new NetStream(connection);
          stream.client = { onMetaData:function(obj:Object):void { } };
          stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
          stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
          video = new Video();
          video.attachNetStream(stream);
          stream.play(null);
          stream.appendBytes( flvData as ByteArray );
          video.width = 356;
          video.height = 356;
          addChild(video);
       public function stop():void {
          if( video != null ) {
             removeChild(video);
          if ( stream != null ) {
             stream.close();
             connection.close();
             stream = null;
             connection = null;
       private function securityErrorHandler(event:SecurityErrorEvent):void {
          trace("securityErrorHandler: " + event);
       private function asyncErrorHandler(event:AsyncErrorEvent):void {
           trace("asyncErrorHandler: " + event);

Similar Messages

  • How to play the two video files simultaneously in Xletview

    Hi All,
    How to play the two video files simultaneously in Xletview. But only one video must be visible to user and the other video must run in the background(Invisible to user). I need to implement like broadcasting channel, I don't want to stop the current video while switching to another video and vice versa.
    Is it possible to do in Xletview 0.3.6?. Or Anybody tried this?...
    Sourab.

    I think no one try this with xletview!
    xletview is not for that!

  • How to play AVI format Video files in Nokia C6

    Hello All,
    How to play AVI format Video files in Nokia C6-00.
    Thanks
    shanth

    Please read this article to see if it helps: http://discussions.nokia.com/t5/Pool-of-Knowledge/What-to-do-if-video-does-not-play-well-on-your-pho...
    As for the app Smart Movie, well that may not be a fully featured video player and as this is a user to user forum for support of Nokia products and services only, you won't find any help here unfortunately.

  • How do I stop Adobe Flash Player from crashing my computer whenever I play a flash video using Mozilla?

    Whenever I try to play a flash video my PC completely crashes or freezes.

    If Flash videos actually crash your entire computer, rather than causing [[The Adobe Flash plugin has crashed]] notice, try this:
    Turn off hardware acceleration in your Flash Player display settings (Right-click on any Flash video, click "Settings", select the Display tab and uncheck “Enable hardware acceleration".
    <img src="http://support.mozilla.com/img/wiki_up/fpSettings1.PNG">
    Ref: http://kb.mozillazine.org/Flash#Performance_or_display_issues_with_certain_Flash_videos
    If you still have problems with Flash, try the troubleshooting suggestions here:
    [[Managing the Flash plugin]]

  • How to play a AVI video file in Nokia 5230

    Hi, Can anybody please tell me the procedure how to play a avi file in Nokia 5230.Thx in advance.

    5230 can't play .avi files out of the box you need to install application like smartmovie player or core player to play it. These two, unfortunately, aren't free. A work around is to convert .avi files to .mp4 format using a video converter like Super by erightsoft(google for it).
    If a reply has solved your problem click Accept as solution button, doing it will help others know the solution. Thanks.

  • How to Play a sample sound using Java

    Hi,
    I have an mp3 music files in database. When a user chooses a particular button, all the songs are fetched from the database.
    I have two buttons namely, 'Buy' and 'Play Sample'. If I click the 'Play Sample' button, a sample of the song has to be played (not the full song). If the user likes the sample, he can buy the full song.
    My question is how to achieve the 'Play Sample' using Java Swings and Sound. I have googled, but not find any solutions. Please provide me an example or link.
    Thanks in advance.

    HI
    Actually i am trying to create a JFrame which plays an mp3 music file
    with the help of play and stop buttons in it ...
    i splitted the frame into two
    i want a music file list in the first frame (JComboBox)
    and want to have play and stop button in the second frame .
    i had tried out some code in which the frame part is fine ,,,
    but i am not knowing how to play the file with those buttons ...
    here is the code and plz help me to move further ...
    import javax.swing.JButton;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JSplitPane;
    public class AudioFile extends JFrame {
        public AudioFile() {
            setTitle("Music File");
            setSize(300, 400);
            JPanel jp1 = new JPanel();
            JPanel jp2 = new JPanel();
            JButton s= new JButton("STOP");
            JButton p= new JButton("PLAY");
            JLabel j1 = new JLabel("MusicFile");
            String[] musicfiles={"file:///home/swathi/Desktop/spot3.mp3","anitha.mp3"};
            JComboBox musiclist=new JComboBox(musicfiles);
            musiclist.setSelectedIndex(1);
            jp1.add(j1);
            jp1.add(musiclist);
            jp2.add(s);
            jp2.add(p);
            JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
                    true, jp1, jp2);
            splitPane.setOneTouchExpandable(true);
            getContentPane().add(splitPane);
        public static void main(String[] args) {
          AudioFile sp = new AudioFile();
            sp.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            sp.setVisible(true);
    }

  • Play a YouTube video using JavaFX components

    I know that we can play a video ( http://zzz/xx/123.flv ), by using the Media View component in JavaFX. In the similar way, is it possible to play a YouTube video in JavaFX ?
    Thank you, for any help in advance.
    Edited by: prabhakar9885 on Sep 17, 2010 4:00 PM

    You might want to take a look at [this thread|http://forums.sun.com/thread.jspa?threadID=5446865], but barring the theoretically possible "hacks" mentioned there, not really.

  • How to play back AVCHD video files without jerkiness result?

    Hi all, I have an iMac 27" 3.06Ghz as well as the new MacBook Air 13 1.86Ghz, and both have 4GB of RAM. When I tried to play back AVCHD video files (*.mts) recorded from my Canon HF200 HD camcorder, the play back is always jerky and choppy. I have tried various software like Perian for QT, VLC, MPlayer Extended, all have the same result. However, I can play back other 1080p files like MKV and MOV just fine.
    Is the jerkiness problem that I am seeing due to underpowered hardware? or is it I am not using the correct software? Note that I am not trying to edit HD videos, I just want to be able to play them back smoothly. I can play the same files on Windows 7 natively without any issues.
    I am curious if any of you have the same problem. Please help!
    Thanks in advance.
    Ken

    Swaza,
    Just thought I would jump in and share some experiences with .tod and .mod files.
    I too have the JVC GZ-HD7 camera and I can confirm that the new version of the MPEG-SC 1.93beta will open and convert .tod to .mov for use with iMovieHD. I am not sure that the files can be used with iMovie08 since I have not tried, but it will work in iMovieHD just like any other qt or .mov file import.
    Also, you can use the QTpro plugin that came with the camera (should be on the CD as the only MAC software available.) This will allow you to open the files in QT and convert them to any other format needed. This plugin unfortunately does not allow QTpro to open the older .mod files of previous JVC cameras. For that you can still use MPEG-SC.
    In my experiences over the last few weeks, having mistakenly dumped all of my footage onto my hdd as I used to do with my older JVC cameras, I am now stuck with 3 hours of footage on my HDD as .tod files. I have been struggling to find the right blend of codec type, compression amount, fps, and quality to convert these files in an acceptable resolution (1920x1080 full - another mistake since iMovie08 will not import this quality but will import the 1440 CBR mode.) Converting these files is a nightmare and has become a stain on my otherwise wonderfu lexperience with this new camera (It is an awesome camera despite what negative stuff the "Canon fanboys" are saying!) It takes an unbelievably long time to convert. And you will find that when viewing these files in QT either as .tod or even after converting to .mov, they will be jerky and stutter. I believe this is more to the fact that the files are just really huge. Playback inside of iMovie06HD was perfect for me though.
    Hope this helps out and I hope others may offer solutions as to what codecs they are using and what settings they are using to keep the quality as high as possible when converting these files.

  • How to play you tube videos on iMac

    How do you play you tube videos on IMAC? is there a video converter software? Thanks!

    You might need to install Flash:
    http://get.adobe.com/flashplayer/

  • How to play you tube video from ipad 3 to my sony hdtv ?

    Can I play You Tube videos from my iPad 3 to my PC and to my Sony HDTV without using cables ?Please advise what I have to do ?

    only way without cables is to buy an appletv

  • How to play Youtube/Hulu videos without disabling hardware acceleration

    I have the Acer AspireRevo AR3700 nettop computer.  I cannot watch any Youtube or Hulu vidoes without disabling hardware acceleration.  I hear sound, but I do not get any video; all I get is a black screen.
    The computer has the latest Nvidia Ion processor.  One of the major selling points of this computer, along with this particular GPU, is that it can play videos WITH hardware acceleration.
    I have searched far and wide on the web and the only solution I can find is to disable hardware acceleration.  Unfortunately, that defeats the purpose of having the Nvidia Ion GPU.
    Please advise me on how I can get the videos to work without having to disable hardware acceleration.  I DO want to take advantage of hardware acceleration, so please do not tell me to simply disable it.
    Please help.

    The native Android Youtube player does a much better job of handing video playback than embeded flash in a browser.

  • How to play an audio file using applicationMusicPlayer ?

    It's easy to play a file using AVAudioPlayer
    NSBundle *mainBundle = [NSBundle mainBundle];
    NSError *error;
    NSURL *tickURL = [NSURL fileURLWithPath:[mainBundle pathForResource:@"tmp" ofType:@"amr"]];
    tickPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:tickURL error:&error];
    [tickPlayer play];
    But how to play a file using applicationMusicPlayer?
    I know setQueueWithItems, but how to prepare the items for it?

    seems not a good question

  • How to play a GP video clip on a PC

    I cant play a GP video clip sent to me on my pc what download do i need and where can i get them

    With "GP video clip" are you referring to the .3gp files that phone cameras usually save videos as?
    If so, the Nokia PC Suite comes with a "View multimedia" app that can show them on Windows:
    http://www.nokia.com/pcsuite
    Apple's QuickTime player can also show the videos (on a PC running Windows or a Mac).
    I should think that the latest RealPlayer can do it on PC's, too.

  • How can I view mpeg videos using QuickTime?

    Having difficulty viewing old mpeg files on my Macbook Pro.. QuickTime won't play it... says:

    Hi,
    See if VLC can play the MPEG video. VLC can play most formats that QuickTime might not be able to play.
    If you like QuickTime, give Perian a try. It's a plug that allows QuickTime to play more video formats.
    Hope this helps.

  • How to play Windows AVI file using Teststand

    Hi,
    I'm trying to play a Windows AVI (*.avi) file using the Windows Media Player, launched by
    a Teststand CallExecutable type step.
    When the step executes, the Windows Media Player app. starts o.k., but the file to be played
    causes an error which states the file type is not recognised.
    Yet if the AVI file is selected in Windows Explorer, it runs fine, i.e. the file type is associated with
    Windows Media Player.
    If the 1st error is ignored, a 2nd is displayed. This states the file cannot be played, and suggests that
    the path may be incorrect or the server is unavailable.
    When configuring the Teststand CallExecutable step, the Argument Expression field contains the full
    absolute address of the AVI (*.avi) file to load and play.
    I have also tried using an expression and also placing the AVI file in the same directory as the
    Windows Media Player .exe, but the file will still not play.
    If I use the Run utility from the Windows Start menu, I can enter the same details on a single command
    line, and the AVI (*.avi) loads and plays just fine.
    What should I do to get Windows Media Player to run the AVI (*.avi) file using the Teststand CallExecutable step ?
    thanks,
    Gary.

    Gary -
    FYI, with TS 3.5, the MessagePopup step can also display html files. The html file can reference the player control and tell it to run immediately. The html code looks like this:
    <HTML>
    <HEAD>
    <TITLE>Multimedia Control Page</TITLE>
    </HEAD>
    <BODY LANGUAGE = VBScript>
    <p>
    My header text
    <p>
    <object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA​6" id="WindowsMediaPlayer1" width="300" height="200">
     <param name="URL" value="c:\windows\clock.avi">
     <param name="rate" value="1">
     <param name="balance" value="0">
     <param name="currentPosition" value="0">
     <param name="defaultFrame" value>
     <param name="playCount" value="1">
     <param name="autoStart" value="-1">
     <param name="currentMarker" value="0">
     <param name="invokeURLs" value="-1">
     <param name="baseURL" value>
     <param name="volume" value="50">
     <param name="mute" value="0">
     <param name="uiMode" value="full">
     <param name="stretchToFit" value="-1">
     <param name="windowlessVideo" value="0">
     <param name="enabled" value="-1">
     <param name="enableContextMenu" value="-1">
     <param name="fullScreen" value="0">
     <param name="SAMIStyle" value>
     <param name="SAMILang" value>
     <param name="SAMIFilename" value>
     <param name="captioningID" value>
     <param name="enableErrorDialogs" value="0">
    </object>
    </p>
    My footer text
    </BODY>
    </HTML>
    Scott Richardson
    National Instruments

Maybe you are looking for

  • Need help in creating job

    Hi Experts, I am trying to schedule a job using DBMS_SCHEDULER. The job has to start on SATURDAY 12:00 midnight and should run every on SATURDAY 12:00 midnight. Even if I create the job on MONDAY first it should start on coming SATURDAY and following

  • Force 16-byte alignment?

    Hello, Is there any way to force the JVM (presumably through the use of some -XX option) to align memory on 16-byte boundaries? I am using x86 hardware features (via JNI) that require 16-byte alignment, and accessing large (Java created) byte arrays

  • Hard Drive Question...

    I've just set up an iMac for my granddad... we're trying to set up Time Machine with his external hard drive, which was previously MS-DOS (FAT32) format. He has some photographs and documents on it that we don't want to copy over to the iMac. I still

  • Why doesn't DW CS4 show complete property panel?

    I've just switched over from "Brand X" to Dreamweaver CS4. I am running a 1680 x 1050 resolution monitor with Windows VISTA Home Premium 32-bit OS. The property inspector panel only partially shows the left sides of the  "Title" and "Target" drop dow

  • HT1766 how can i restore my iphone from an old backup?

    hi! does anybody know how to restore from an old backup? I backed up my phone this morning and deleted a bunch of pictures on it to see if it would help with the issue of it being slow, it didn't. When I plugged up my phone back in, it automatically