Streaming MP4 video

Actionscript 2.0 questions.

Streaming MP4 video

Postby nnnswordfish » Tue Apr 26, 2011 9:29 pm

hy :) i am working on my new project and i want to play streaming mp4 video in it ...so is it possible to play streaming mp4 in as 2.0? if yes can some one give tutorial link?or something .. thanks :)

i tried like this but no luck.... it only starts playing when video is loaded fully

Code: Select all
var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new NetStream(nc);
theVideo.attachVideo(ns);
ns.setBufferTime(1);

ns.play("INTRO.mp4");


please help me :)
User avatar
nnnswordfish
 
Posts: 176
Joined: Wed Dec 12, 2007 5:21 pm

Re: Streaming MP4 video

Postby devonair » Wed Apr 27, 2011 12:19 pm

3 things - as 2.0 and .mp4 really make no difference - the question is, is the video encoded in h.264 and are you using Flash Player 9.0.124 or higher? If so, it should work.

The third thing, and the thing it sounds like you're having trouble with is something called a MOOV atom contained in h.264 video. Very basically put, this is like a block of code that contains header info that Flash needs to read in order to play the video. In some cases, this MOOV atom is placed in the front of the encoded video which makes everything fine, but in others it's placed at the end so Flash needs to load the entire video before it can play. The simplest way I've found for fixing that is to run your video through this great AIR application: http://renaun.com/blog/code/qtindexswapper/ . It will swap the MOOV atom to the front of the file and it should be fine.

Oh, and a 4th thing - you're really trying to progressively download - not stream. A nitpicky difference, but one of my (several) personal pet peeves.. :)
User avatar
devonair
 
Posts: 657
Joined: Sun Apr 09, 2006 8:42 am
Flash Version: Adobe Flash CS5.5
Authoring Environment: Microsoft Windows

Re: Streaming MP4 video

Postby nnnswordfish » Wed Apr 27, 2011 7:59 pm

thanks uuuuuuuuuuuuu i did it............ :) thanksssssssssssssss
User avatar
nnnswordfish
 
Posts: 176
Joined: Wed Dec 12, 2007 5:21 pm

Re: Streaming MP4 video

Postby devonair » Thu Apr 28, 2011 8:22 am

Great news! Glad you got it working.
User avatar
devonair
 
Posts: 657
Joined: Sun Apr 09, 2006 8:42 am
Flash Version: Adobe Flash CS5.5
Authoring Environment: Microsoft Windows

Re: Streaming MP4 video

Postby nipul » Thu Nov 24, 2011 8:17 am

Hi nnnswordfish,

I try to resolve the same problem. currently i am trying to play mp4 audio and video files in flash player using action script 2.0. right now i play mp3 audio file and flv video file in flash. but now as technology upgrade i need to play mp4 format for audio & video in flash. i tried with our old code and i am failed to do it. so please help me and can u explain me how you achive to do the same in AS2.0.

Thanks in advance. :)
nipul
 
Posts: 1
Joined: Thu Nov 24, 2011 8:10 am
Flash Version: Adobe Flash CS3


Return to Actionscript 2.0

Who is online

Users browsing this forum: No registered users and 2 guests