Package com.wowza.wms.stream.publish
Class Stream
Object
com.wowza.wms.stream.publish.Stream
- All Implemented Interfaces:
Runnable
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(IStreamActionNotify listener) Add a listenerbooleanaddToPlaylist(int index, String name, int start, int length) Inserts a media source item to this playlist at a particular index, without interruption.booleanaddToPlaylist(String existing, String name, int start, int length) Insert item into playlist just after the first item in the playlist with a given name.voidclose()Call this method when you have finished with the playlist object.voidCall this method when you have finished with the playlist object.static StreamcreateInstance(IApplicationInstance appInstance, String sName) Use this to create a named Stream on an application instance.static StreamcreateInstance(IVHost vhost, String applicationName, String streamName) Use this to create a named Stream on the default instance (_definst_) of an application on a particular VHost.static StreamcreateInstance(IVHost vhost, String applicationName, String appInstanceName, String streamName) Use this to create a named Stream on the non-default instance of an application on a particular VHost.static StreamcreateInstance(IVHost vhost, String applicationName, String appInstanceName, String streamName, String streamType) Use this to create a named Stream on the non-default instance of an application on a particular VHost.Get the currently playing playlist itemgetLock()Get the synchronization lock for this interface.getName()Returns the name of the playlist stream - the client would play this stream by this name.Get the current playlistintGet the polling interval (milliseconds)booleanUse this to determine if the playlist is auto-repeatinglongGet time in milliseconds to go back in live stream buffer to get previous key frameintGet time in milliseconds to add to stream time between playlist items (default is zero)doublebooleanIf true, will move to next playlist item if live stream is missing or is unpublished.booleanTrue if sending onMetadata eventsbooleanSet to true to start live streams on most recent key frame (smoother switching)booleanLog when a playlist switch occursbooleanIf true start time and duration and are milliseconds.booleanIf true, stop publishing if end of playlist and repeat is falsevoidnext()voidnext(int step) voidplay(int index) booleanAdd a media item to the playlist as defined by an XML file ..booleanAdds a media source item to this playlist -voidprevious()voidprevious(int step) booleanremoveFromPlaylist(int index) Remove item from playlist based on index.booleanremoveFromPlaylist(String name) Remove all items matching the given stream name from the playlist.voidremoveListener(IStreamActionNotify listener) Remove a listenervoidrun()Overridden from class Runnable ....voidsetMoveToNextIfLiveStreamMissing(boolean moveToNextIfLiveStreamMissing) If true, will move to next playlist item if live stream is missing or is unpublished.voidsetPollingInterval(int pollingInterval) Set the polling interval (milliseconds)voidsetRepeat(boolean repeat) Use this to make the playlist repeat or not...voidsetSendOnMetadata(boolean sendOnMetadata) True if sending onMetadata eventsvoidsetStartLiveOnPreviousBufferTime(long startLiveOnPreviousBufferTime) Set time in milliseconds to go back in live stream buffer to get previous key framevoidsetStartLiveOnPreviousKeyFrame(boolean startLiveOnPreviousKeyFrame) Set to true to start live streams on most recent key frame (smoother switching)voidsetSwitchLog(boolean switchLog) Log when a playlist switch occursvoidsetTimeOffsetBetweenItems(int timeOffsetBetweenItems) Set time in milliseconds to add to stream time between playlist items (default is zero)voidsetTimesInMilliseconds(boolean timesInMilliseconds) If true start time and duration and are milliseconds.voidsetUnpublishOnEnd(boolean stopOnEnd) If true, stop publishing if end of playlist and repeat is falsevoidsetVODSpeed(double vodSpeed)
-
Field Details
-
CLASS
-
CLASSNAME
- See Also:
-
-
Constructor Details
-
Stream
public Stream()
-
-
Method Details
-
createInstance
Use this to create a named Stream on the default instance (_definst_) of an application on a particular VHost.- Parameters:
vhost- - Virtual HostapplicationName- - Application namestreamName- - Name of Stream- Returns:
- stream interface
-
createInstance
public static Stream createInstance(IVHost vhost, String applicationName, String appInstanceName, String streamName) Use this to create a named Stream on the non-default instance of an application on a particular VHost.- Parameters:
vhost- - Virtual HostapplicationName- - Application nameappInstanceName- - Instance namestreamName- - Name of Stream- Returns:
- stream interface
-
createInstance
public static Stream createInstance(IVHost vhost, String applicationName, String appInstanceName, String streamName, String streamType) Use this to create a named Stream on the non-default instance of an application on a particular VHost.- Parameters:
vhost- - Virtual HostapplicationName- - Application nameappInstanceName- - Instance namestreamName- - Name of StreamstreamType- - Stream type- Returns:
- stream interface
-
getLock
Get the synchronization lock for this interface.- Returns:
- synchronization lock for this interface
-
createInstance
Use this to create a named Stream on an application instance.- Parameters:
appInstance- - Application instancesName- - Name of Stream- Returns:
- stream interface
-
run
public void run()Overridden from class Runnable .... do NOT call this directly. This method handles switching between media sources in the playlist. -
getPlaylist
Get the current playlist- Returns:
- current playlist
-
getCurrentItem
Get the currently playing playlist item- Returns:
- currently playing playlist item
-
play
Adds a media source item to this playlist -- Parameters:
name- - name of media itemstart- - where to start playing the item. (-2 implies play a live stream)length- - how much of the item to play (-1 implies play the entire file or live stream)reset- - if true, will begin a new playlist, otherwise items are appended- Returns:
- - returns true if item was added successfully ...otherwise false.
-
addToPlaylist
Inserts a media source item to this playlist at a particular index, without interruption.- Parameters:
index- - insertion indexname- - name of media item being insertedstart- - where to start playing the item. (-2 implies play a live stream)length- - how much of the item to play (-1 implies play the entire file or live stream)- Returns:
- - returns true if item was inserted successfully ...otherwise false. this should not interrupt anything that might be currently playing.... will do nothing if existing item does not exist.. if existing == "" insert at head of list
-
addToPlaylist
Insert item into playlist just after the first item in the playlist with a given name.- Parameters:
existing- name of playlist item in which to insert the item aftername- name of new itemstart- where to start playing the item. (-2 implies play a live stream)length- how much of the item to play (-1 implies play the entire file or live stream)- Returns:
- true if item inserted
-
removeFromPlaylist
public boolean removeFromPlaylist(int index) Remove item from playlist based on index.- Parameters:
index- item index- Returns:
- true if at least one item from removed
-
removeFromPlaylist
Remove all items matching the given stream name from the playlist. If the item is currently being played, it is not removed.- Parameters:
name- stream name- Returns:
- true if at least one item from removed
-
play
Add a media item to the playlist as defined by an XML file ..- Parameters:
sPlaylist- - the playlist XML definition file- Returns:
- - returns true if item was added successfully ...otherwise false.
-
close
public void close()Call this method when you have finished with the playlist object. It will terminate the playlist thread. The playlist object cannot be used after this call. -
closeAndWait
public void closeAndWait()Call this method when you have finished with the playlist object. It will terminate the playlist thread. The playlist object cannot be used after this call. This method will wait for the thread to exit. -
getName
Returns the name of the playlist stream - the client would play this stream by this name.- Returns:
- - the name of the playlist stream
-
getRepeat
public boolean getRepeat()Use this to determine if the playlist is auto-repeating- Returns:
- - true if repeating otherwise false.
-
setRepeat
public void setRepeat(boolean repeat) Use this to make the playlist repeat or not...- Parameters:
repeat- - true to repeat otherwise false
-
play
public void play(int index) -
next
public void next(int step) -
next
public void next() -
previous
public void previous() -
previous
public void previous(int step) -
getPollingInterval
public int getPollingInterval()Get the polling interval (milliseconds)- Returns:
- polling interval (milliseconds)
-
setPollingInterval
public void setPollingInterval(int pollingInterval) Set the polling interval (milliseconds)- Parameters:
pollingInterval- polling interval (milliseconds)
-
getPublisher
-
addListener
Add a listener- Parameters:
listener- listener
-
removeListener
Remove a listener- Parameters:
listener- listener
-
isSwitchLog
public boolean isSwitchLog()Log when a playlist switch occurs- Returns:
- log when a playlist switch occurs
-
setSwitchLog
public void setSwitchLog(boolean switchLog) Log when a playlist switch occurs- Parameters:
switchLog- log when a playlist switch occurs
-
isSendOnMetadata
public boolean isSendOnMetadata()True if sending onMetadata events- Returns:
- True if sending onMetadata events
-
setSendOnMetadata
public void setSendOnMetadata(boolean sendOnMetadata) True if sending onMetadata events- Parameters:
sendOnMetadata- True if sending onMetadata events
-
isTimesInMilliseconds
public boolean isTimesInMilliseconds()If true start time and duration and are milliseconds. If false startTime and duration are in seconds.- Returns:
- true start time and duration and are milliseconds
-
setTimesInMilliseconds
public void setTimesInMilliseconds(boolean timesInMilliseconds) If true start time and duration and are milliseconds. If false startTime and duration are in seconds.- Parameters:
timesInMilliseconds- true start time and duration and are milliseconds
-
isStartLiveOnPreviousKeyFrame
public boolean isStartLiveOnPreviousKeyFrame()Set to true to start live streams on most recent key frame (smoother switching)- Returns:
- true to start live streams on most recent key frame
-
setStartLiveOnPreviousKeyFrame
public void setStartLiveOnPreviousKeyFrame(boolean startLiveOnPreviousKeyFrame) Set to true to start live streams on most recent key frame (smoother switching)- Parameters:
startLiveOnPreviousKeyFrame- true to start live streams on most recent key frame
-
getStartLiveOnPreviousBufferTime
public long getStartLiveOnPreviousBufferTime()Get time in milliseconds to go back in live stream buffer to get previous key frame- Returns:
- time in milliseconds to go back in live stream buffer to get previous key frame
-
setStartLiveOnPreviousBufferTime
public void setStartLiveOnPreviousBufferTime(long startLiveOnPreviousBufferTime) Set time in milliseconds to go back in live stream buffer to get previous key frame- Parameters:
startLiveOnPreviousBufferTime- time in milliseconds to go back in live stream buffer to get previous key frame
-
getTimeOffsetBetweenItems
public int getTimeOffsetBetweenItems()Get time in milliseconds to add to stream time between playlist items (default is zero)- Returns:
- time in milliseconds to add to stream time between playlist items
-
setTimeOffsetBetweenItems
public void setTimeOffsetBetweenItems(int timeOffsetBetweenItems) Set time in milliseconds to add to stream time between playlist items (default is zero)- Parameters:
timeOffsetBetweenItems- time in milliseconds to add to stream time between playlist items
-
isMoveToNextIfLiveStreamMissing
public boolean isMoveToNextIfLiveStreamMissing()If true, will move to next playlist item if live stream is missing or is unpublished.- Returns:
- move to next playlist item if live stream is missing or is unpublished
-
setMoveToNextIfLiveStreamMissing
public void setMoveToNextIfLiveStreamMissing(boolean moveToNextIfLiveStreamMissing) If true, will move to next playlist item if live stream is missing or is unpublished.- Parameters:
moveToNextIfLiveStreamMissing- move to next playlist item if live stream is missing or is unpublished
-
isUnpublishOnEnd
public boolean isUnpublishOnEnd()If true, stop publishing if end of playlist and repeat is false- Returns:
- stop publishing if end of playlist and repeat is false
-
setUnpublishOnEnd
public void setUnpublishOnEnd(boolean stopOnEnd) If true, stop publishing if end of playlist and repeat is false- Parameters:
stopOnEnd- stop publishing if end of playlist and repeat is false
-
getVODSpeed
public double getVODSpeed() -
setVODSpeed
public void setVODSpeed(double vodSpeed) -
getStreamType
-