Skip to main content
January 4, 2010
Question

Can I publish static content to Live stream

  • January 4, 2010
  • 1 reply
  • 462 views

I have a requirement of publishing static content like video files mentioned in a playlist to be published to a live stream. It is like creating a TV station with pre-recorded content but with live stream. It will great  if anyone let me know is it possible with FMS?

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    January 6, 2010

    Yes its very much possible.

    What you need to do is place all your files on server and play it via server-side stream. You can go through FMS documentation and you should be able to get it work. However i will tell you briefly here how to go about it.

    Create an application folder , under applications directory of FMS. Let us name it as "test". Create a folder called "streams" under "test" and then under "streams" create "room" folder. So structure would be as follows : <FMS installation directory>/applications/streams/room. Now place all your static content here , say you place one.mp4,two.mp4,three.mp4.

    Now you want to give effect of live stream.

    Create a file called main.asc under "test" folder.

    Write below code in main.asc:

    var mylivestream;

    application.onAppStart = function(){

         mylivestream = Stream.get("mp4:livestream.mp4");

         mylivestream.play("mp4:one.mp4",0,-1,true);

         mylivestream.play("mp4:two.mp4",0,-1,false);

         mylivestream.play("mp4:three.mp4",0,-1,false);

    }

    Above code would play all three static content one after other. Subscriber client would have to subscribe in following manner:

    ns.play("mp4:livestream.mp4",-1,-1)

    Please note that above code is sample code and not the most optimal or correct and will need tweaking depending on what is your requirement.

    Hope this helps