Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How do I seek to a specific point in a mp4 (locally)

New Here ,
Jun 06, 2013 Jun 06, 2013

Hi,

I have an air destop project that displays local mp4 videos.

But Sometimes I want the video to play from a specific position for example 5seconds in.

Im just not getting anywhere trying to manipulate the the netstream.

I want to start an mp4 playing from a specific position.

so for example ive tried this...




stream.play(videoURL);



stream.pause();





stream.seek(30);



stream.resume();

This doesnt work though the playback just starts from 0 seconds like it normally would.

Any ideas?

Thanks

TOPICS
ActionScript
2.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 06, 2013 Jun 06, 2013

You can just specify the seconds to start at with play(),

e.g.:

stream.play('mp4:videos/myvideo.mp4',30);

Playing locally you still do need to make sure the file is loaded to that second before you seek to it. Seeking progressive without a media server will also only seek to keyframes. It's an expensive operation.

In normal seek mode, you cannot start the video at a point between the keyframes.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#seek()

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 07, 2013 Jun 07, 2013

ahh ok so how do I check to see if its loaded up to that second... and if it isnt how do I make?

Thanks

Aidan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 07, 2013 Jun 07, 2013

AHH SORTED!

Listen to net_status for "NetStream.Buffer.Full"

Thanks for your help sinious.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 11, 2013 Jun 11, 2013
LATEST

You're welcome and just be careful that your buffer is at least 40 seconds in length, otherwise that event won't be as useful. It's pretty hard to know exactly the duration of audio loaded. You can request to play a specific second in which Flash will wait until it's loaded and then begin playback. You'll get a playback event at that point when playback begins. Until you receive the event that playback has started you can just display some kind of "loading" message to the user.

Glad you got it resolve. Good luck!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines