A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: [CS4] VideoPlayer class problem

  1. #1
    Member
    Join Date
    Sep 2007
    Posts
    47

    Unhappy [CS4] VideoPlayer class problem

    The problem I have is simple: the play and load functions doesn't work in flash CS4 as defined in the documentation:

    http://help.adobe.com/en_US/AS3LCR/F...deoPlayer.html

    So to speak, I can only define like this:

    http://livedocs.adobe.com/flash/9.0/...deoPlayer.html

    My flash player version on all 3 fla files that I use is set to 10.

    And now with the GREAT issue I can't set startTime for the video and this is just GREAT GREAT GREAT !!!

    I would appreciate any help/ideas etc! Thank you.

  2. #2
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    You should inform Adobe, but you can bypass that as shown in the example below. 5000 is is 5sec.
    PHP Code:
    package 
    {
        
    import fl.video.VideoPlayer;
        
    import flash.display.Sprite;
        
    import flash.utils.setTimeout;
        public class 
    VideoPlayerExample extends Sprite
        
    {
            private var 
    videoPath:String "http://www.helpexamples.com/flash/video/sheep.flv";
            private var 
    player:VideoPlayer;

            public function 
    VideoPlayerExample ():void
            
    {
                
    player = new VideoPlayer  ;
                
    player.load (videoPath);
                
    player.setScale (0.75,0.75);
                
    addChild (player);
                var 
    intervalId:int setTimeout(myDelayedFunction,5000);
            }
            private function 
    myDelayedFunction ():void
            
    {
                
    player.play ();
            }
        }

    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Member
    Join Date
    Sep 2007
    Posts
    47
    hi cancerinform, thank you for the reply!

    I think you misunderstood what startTime is for. I will copy paste it for you:

    startTime:Number (default = NaN) Time, in seconds, to be treadted as time 0 in the given media. Play will start from there, the playheadTime will consider startTime to be time 0 and it will not be possible to seek to before this time (seeking to 0 would seek to the given startTime). This parameter is ignored if isLive is true.

    By defining this value I should be able to set a point from which the movie will start to play. For example I have a movie long 2 minutes and It's starts playing but then I have a buffer which I have to wait for 1 minute till I see what happens at that point of the movie. With this I should be able to bypass that. So to speak it should work just like the youtube player and just as described in the paragraph I pasted you above.
    I click on the progress bar => The head moves there the movie stream closes and starts all over again from that point, if you try to go back then it's start all over again from that point. Of course unless you have your movie downloaded already from time 0 to the end.

    So I don't need delaying the movie's playback I need to be able to specify at which point the movie to start buffering and playing like you tube player.

    I hope you have answer for this

  4. #4
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Why don't you use seek then?
    - The right of the People to create Flash movies shall not be infringed. -

  5. #5
    Member
    Join Date
    Sep 2007
    Posts
    47
    Hi again,

    you can use seek only on the part of the flv which has already downloaded (so to speak has been buffered). And my point was to start buffering from a specific point so you don't have to wait.

    For example you have 2 hours movie and you closed it 30 mins before the end so your boss didn't see you watching movies at work

    Then the boss is gone and you want to watch the last 30 mins. You open it and omg.. I have to wait again for the movie to buffer 1 hour and 30 mins until I can play that part. And you would usually want skipping that part and start buffering from the point of 1 hour and 30 mins.

    I hope now you understand my point

  6. #6
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    I did some research. Apparently with Flash 8 it works. The Flash 9 VideoPlayer class function play has only 3 arguments although 6 are listed in the lang. ref.

    I found this
    http://www.topfstedt.de/weblog/?page_id=208
    which may solve your problem.
    - The right of the People to create Flash movies shall not be infringed. -

  7. #7
    Member
    Join Date
    Sep 2007
    Posts
    47
    well the swf is in flash player 8 and it's done in flex which is kinda different. Thanks for the help anyways.

    And so if somebody is aware if there is any alternative way to achieve of what I was talking about in the new flash CS4 version I would help a lot. I seems very stupid to me to have this option in Flash 8 and not in Flash CS4 and to have it in the docs. Ugly picture..

    So any help will be appreciated..

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center