Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: How can I know when a playlist ends?

  1. #1
    Join Date
    Jul 2011
    Posts
    104

    Default How can I know when a playlist ends?

    Hey Guys!

    First off, cheers for all the help you've given us ove the years, you guys are awesome.

    Second, is there any way I can know when a playlist using the ServerListenerStreamPublisher has finished? As in, the last item has finished playing.

    Thanks!

  2. #2

    Default

    Hi Benny,

    Is onPlaylistItemStop() what you're looking for? Check the API docs for info on this method.

  3. #3
    Join Date
    Jul 2011
    Posts
    104

    Default

    Hey Randall,

    Thanks for the reply. Well, I'm using that method already to know when a particular playlist item (like a song) stops. But is there something I can listen in for knowing when an entire playlist has completed playing?

    I mean, I guess I could use onPlaylistItemStop to see if it's the last item in a playlist, but that feels a bit hacky to me.

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

    Default

    Take a look at IMediaStreamActionNotify3.onUnPublish()

    http://www.wowza.com/forums/content....-of-codec-info

    Richard

  5. #5
    Join Date
    Jul 2011
    Posts
    104

    Default

    Hey Richard,

    Sorry to smear noob sauce all over the place but can you show me a quick example of how to use this interface with a Stream instance and not a MediaStream instance?

    According to the docs, the Stream.addListener method takes an instance of IStreamActionNotify.

    Here's the chunk of code I'm working through in the ServerListenerStreamPublisher example...

    Stream stream = streamMap.get(streamName);
    stream.setSendOnMetadata(passThruMetaData);
    ScheduledItem item = new ScheduledItem(startTime, playlist, stream, isLiveEvent);
    item.start();

    IStreamActionNotify actionNotify = new StreamListener(app.getAppInstance("_definst_"));
    stream.addListener(actionNotify);

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

    Default

    The Stream instance is a MediaStream, so if you setup IMediaStreamActionNotify3 then start Stream class stream you will see the IMediaStreamActionNotify3.onPublish() event will run. When it is over, onUnPublish should run.

    Richard

  7. #7
    Join Date
    Jul 2011
    Posts
    104

    Default

    kick ass dude, lemme give it a shot. I'll let you guys know... thanks so much!

  8. #8
    Join Date
    Jul 2011
    Posts
    104

    Default

    Hey Richard,

    No dice... check out the error my IDE gives me: The method addListener(IStreamActionNotify) in the type Stream is not applicable for the arguments (ServerListenerStreamPublisher.StreamListener)

    Where ServerListenerStreamPublisher.StreamListener is an instance of IMediaStreamActionNotify3

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

    Default

    Use the IMediaStreamActionNotify3 example exactly as is. It will work.

    Richard

  10. #10
    Join Date
    Jul 2011
    Posts
    104

    Default

    Hey Richard,

    I really appreciate your help here, but I'm afraid I'm a bit lost. Let me explain what I need to do in a bit more detail, perhaps it'll help me think through this approach a bit more.

    Using the ServerListenerStreamPublisher I need to know when the playlist is finished playing. I tried attaching a listener instance of IMediaStreamActionNotify3 to the Stream class, but it wasn't allowed, nor could I cast the Stream as an IMediaStream type with the support for IMediaStreamActionNotify3.

    Now, I tried following the example link you sent, but I'm afraid that's where I got a bit lost. If I add that module to my app, none of those events get hit. And given that it's from a playlist the stream is created before the app instance is even run. I'm probably totally thinking about this the wrong way though.

    Can I get a super quick/dirty example of how to attach the listener I need inside the ServerListenerStreamPublisher class? That'll go a long way for me dude, I'd hate to keep bothering you guys about stuff like this.

Page 1 of 2 12 LastLast

Similar Threads

  1. Record Live Stream - Playing back before recording ends
    By grantk in forum AddOn: Other AddOns
    Replies: 4
    Last Post: 04-02-2012, 01:53 PM
  2. Replies: 5
    Last Post: 11-16-2011, 10:30 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
  •