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

start an MP4 from a defined seconds and end in another

Contributor ,
Mar 28, 2017 Mar 28, 2017

If I have XML like this:

<videoTime start="35" end="111"></videoTime>

How can I have the SWF reads the time and play at 35 seconds and stops at 111 seconds?

Thanks,

TOPICS
ActionScript
805
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
Community Expert ,
Mar 28, 2017 Mar 28, 2017

use actionscript.

var s:Sound = YourSound();

var sc:SoundChannel = s.play(35000);

var t:Timer=new Timer(111,1);

t.addEventListener(TimerEvent.TIMER,sF);

t.start();

function sF(e:TimerEvent):void{

sc.stop();

}

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 ,
Mar 28, 2017 Mar 28, 2017

That would be the answer for MP3. The question was about MP4.

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
Community Expert ,
Mar 28, 2017 Mar 28, 2017

oops.

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
Community Expert ,
Mar 28, 2017 Mar 28, 2017

are you using an flvplayback component to play your video?  the netstream class?  something else?

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
Contributor ,
Mar 28, 2017 Mar 28, 2017

Thank you, Kglad and Colin. I've not decided as I'm converting from AS2. It's custom UI so I think netstream is more likely.

Thanks,

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
Community Expert ,
Mar 28, 2017 Mar 28, 2017
LATEST

you play the steam and then immediately pause it.  repeatedly check the bytesLoaded (though bufferLength should be better, but i've had problems with it in the past) and when enough data is loaded use the seek method to start play at 35 seconds.

you can use a timer like the above to stop play (or use a a loop and repeatedly check the netstream's time property).

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