Skip to main content
Participant
May 23, 2012
Question

live streaming from mp4 file

  • May 23, 2012
  • 1 reply
  • 1082 views

Hello everybody,

I know that's a noob question (as I am) but i can't make it run.

I have an mp4 file and the folders structure is....

Application/test/sources/_definst_

in _definst_ source.mp4

in test folder main.asc file

main.asc file contains

var mystream;

var intervalID;

application.onAppStart = function(){

mystream = Stream.get("mylive");

intervalID = setInterval(startPublish,100); / checking every 100 ms if we can start publish

}

function startPublish(){

if(checkTime() == true){

clearInterval(intervalID ); //clearing the interval so that startPublish won't be called again

myStream.play("mp4:sample.mp4",0,-1,true) //starting the live publish of recorded file sample.mp4

}

}

function checkTime(){

myDate = new Date();

if(myDate.getHours() == 21) // This means its 2 PM

return true;

else

return false;

}

All this stuff doesn't work. When I go to the admin panel and select test under new instance the stream appears on the left side but if press enter on _definst_ it disappears from the column.

What's wrong?

Is possible with this code run that video on ios devices?

Thank you very much

    This topic has been closed for replies.

    1 reply

    djlight82Author
    Participant
    May 24, 2012

    may be a problem of the main.asc file?

    May 24, 2012

    Hi,

    By default the FMS looks for the media under <application>/streams/_definst_/ and not sources/_definst_/. In case you want to specify the media location then copy the Application.xml from the vod sample application and edit the Streams tag. For eg :

    <StreamManager>

                        <VirtualDirectory>

          <!-- Specifies application specific virtual directory mapping for recorded streams.   --> 

           <Streams>/;<root_install>/applications/vod/sources/_definst_/</Streams>    

                        </VirtualDirectory>

    </StreamManager>

    This should solve your problem. The main.asc is fine.

    Hope this helps.

    Thanks,

    Apurva

    djlight82Author
    Participant
    May 24, 2012

    This should also work with ios devices? Should I use http streaming url instead of rtmp?