Results 1 to 5 of 5

Thread: Cannot get new Playlist to open on existing Stream

  1. #1

    Default Cannot get new Playlist to open on existing Stream

    Hi All,
    I am working on a "scheduled streaming" module based on the sample code provided here

    The schedule loading works properly only when I start/restart the application. I cannot get the schedule to change when I create a new Playlist and assign it to an active stream.

    The most notable change I've made from the original code is that I am attempting to reuse the existing streams, rather than creating new Streams every time a playlist is loaded.

    //only create a Stream if one of the same name does not already exist
    	Stream stream = Stream.createInstance(appInstance, streamName);
    	streamMap.put(streamName, stream);
    	appInstance.getProperties().setProperty(streamName, stream);
    Once a new playlist is loaded, the TimerTask runs correctly, and attempts to open the playlist on the existing stream:
    public void run() {
    		getLogger().info("Stream switched to new Playlist: " + mStream.getName() + "->"+mPL.getName());
    		getLogger().error("Unable to update Stream to new Playlist: " + mStream.getName() + "->"+mPL.getName());
    I ALWAYS see the error message at this point, indicating that has returned false.

    Can you provide any clues as to why this would be? Do I have to recreate the Stream every time a playlist is loaded? The API documentation seems to support my approach, but I am at a loss here.

    Thanks in advance

  2. #2
    Join Date
    Dec 2007


    Take a look at this example of how to dynamically control Stream class streams


  3. #3


    Hi Richard,
    Thanks for the quick reply. As far as I can tell, I am following that example.

    Specifically, I need to know in what cases calling would fail - so that I can debug further.

    I have a reference to a Playlist, and a reference to a Stream, yet always returns false and nothing changes in the playback.

    From the API documentation:

    public boolean open(Stream s)
    Opens this playlist on the given stream... stopping anything currently playing on that stream and switching over.
    s - - stream to play on
    - true if successful

    Obviously, there are reasons why this method would return false and fail to update the stream - I just need some guidance on what those conditions could be.


  4. #4


    Just wanted to report back that I have determined the issue and rectified it.

    I began this project using various samples provided in these forums, and I had left the pre-compiled ServerListener "ServerListenerStreamPublisher" active in my installation.

    The server listener was competing with my custom Module, and the signals got crossed causing erratic behavior.

    Removing that ServerListener allowed me to address the problems in my own code properly.


  5. #5
    Join Date
    Dec 2007


    Great. Glad it's sorted. Thanks for the update


Similar Threads

  1. Replies: 3
    Last Post: 05-21-2014, 09:30 PM

Posting Permissions

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