Results 1 to 7 of 7

Thread: Pass mp3/video name and data from playlist smil into the stream

  1. #1
    Join Date
    Jul 2011
    Posts
    104

    Default Pass mp3/video name and data from playlist smil into the stream

    Hey Guys,

    If we're using a playlist and the ServerListenerStreamPublisher, how do we pass information about the current playlist item into the client? Things like title, artist, and any other bits we may need.

    Any suggestions?

  2. #2
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Take a look at the onPlayListItemStart handler (of the IStreamActionNotify interface) at the bottom of the example:
    http://www.wowza.com/forums/content....t-in-smil-file

    public void onPlaylistItemStart(Stream stream, PlaylistItem item) 
            {
                try
                {
                String name = stream.getCurrentItem().getName();
                stream.getPublisher().getAppInstance().broadcastMsg("PlaylistItemStart", name);
                WMSLoggerFactory.getLogger(null).info("ServerListenerStreamPublisher PlayList Item Start: " + name);
                }
                catch(Exception ex)
                {
                    WMSLoggerFactory.getLogger(null).info("ServerListenerStreamPublisher Get Item error: " + ex.getMessage());
                }
            }
    This line is already sending info to all Flash RTMP clients (but not other types):

    stream.getPublisher().getAppInstance().broadcastMsg("PlaylistItemStart", name);
    A little farther down, I show how to listen in Flash RTMP client:

    var clientObj:Object = new Object();
    clientObj.PlaylistItemStart(itemName:String):void
    {
    trace("Item Name: " + itemName);
    });
    
    netconnection.client = clientObj;
    netconnection.connect("rtmp://[wowza-address]:1935/[app-name]");
    Richard

  3. #3
    Join Date
    Jul 2011
    Posts
    104

    Default

    Hey Richard,

    This makes total sense, and we're using it, however... What about when a user connects to the application while the song is playing and not when it's changing?

  4. #4
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    You should be able to adapt the injectMetadata function in this example:

    http://www.wowza.com/forums/content....point-MetaData

    If you modify the stream's MetaData in the onPlaylistItemStart, a new client could get that info from the NetStream.onMetaData handler.

    Richard

  5. #5
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Another approach would be to use a SharedObject.

    http://www.wowza.com/forums/content....le-track-users

    You can add data to the shared object in onPlaylistItemStart.

    Richard

  6. #6
    Join Date
    Jul 2011
    Posts
    104

    Default

    Excellent dude, onMetaData should do the trick. Thanks!

  7. #7
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Cool, you're welcome.

    Richard

Similar Threads

  1. Replies: 1
    Last Post: 10-10-2014, 08:07 AM
  2. Live. SMIL playlist. Data transfer from server to off-site destination
    By glorin in forum Live Streaming and Encoder Discussion
    Replies: 1
    Last Post: 05-18-2013, 12:42 PM
  3. Replies: 1
    Last Post: 09-10-2012, 04:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •