Runnablepublic class Stream
extends Object
implements Runnable
| Constructor | Description |
|---|---|
Stream() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addListener(IStreamActionNotify listener) |
Add a listener
|
boolean |
addToPlaylist(int index,
String name,
int start,
int length) |
Inserts a media source item to this playlist at a particular index,
without interruption.
|
boolean |
addToPlaylist(String existing,
String name,
int start,
int length) |
Insert item into playlist just after the first item in the playlist with a given name.
|
void |
close() |
Call this method when you have finished with the playlist object.
|
void |
closeAndWait() |
Call this method when you have finished with the playlist object.
|
static Stream |
createInstance(IApplicationInstance appInstance,
String sName) |
Use this to create a named Stream on an application instance.
|
static Stream |
createInstance(IVHost vhost,
String applicationName,
String sName) |
Use this to create a named Stream on the default instance (_definst_) of
an application on a particular VHost.
|
static Stream |
createInstance(IVHost vhost,
String applicationName,
String appInstanceName,
String sName) |
Use this to create a named Stream on the non-default instance of an
application on a particular VHost.
|
static Stream |
createInstance(IVHost vhost,
String applicationName,
String appInstanceName,
String sName,
String streamType) |
Use this to create a named Stream on the non-default instance of an
application on a particular VHost.
|
PlaylistItem |
getCurrentItem() |
Get the currently playing playlist item
|
Object |
getLock() |
Get the synchronization lock for this interface.
|
String |
getName() |
Returns the name of the playlist stream - the client would play this
stream by this name.
|
java.util.List<PlaylistItem> |
getPlaylist() |
Get the current playlist
|
int |
getPollingInterval() |
Get the polling interval (milliseconds)
|
Publisher |
getPublisher() |
|
boolean |
getRepeat() |
Use this to determine if the playlist is auto-repeating
|
long |
getStartLiveOnPreviousBufferTime() |
Get time in milliseconds to go back in live stream buffer to get previous key frame
|
String |
getStreamType() |
|
int |
getTimeOffsetBetweenItems() |
Get time in milliseconds to add to stream time between playlist items (default is zero)
|
double |
getVODSpeed() |
|
boolean |
isMoveToNextIfLiveStreamMissing() |
If true, will move to next playlist item if live stream is missing or is unpublished.
|
boolean |
isSendOnMetadata() |
True if sending onMetadata events
|
boolean |
isStartLiveOnPreviousKeyFrame() |
Set to true to start live streams on most recent key frame (smoother switching)
|
boolean |
isSwitchLog() |
Log when a playlist switch occurs
|
boolean |
isTimesInMilliseconds() |
If true start time and duration and are milliseconds.
|
boolean |
isUnpublishOnEnd() |
If true, stop publishing if end of playlist and repeat is false
|
void |
next() |
|
void |
next(int n) |
|
void |
play(int n) |
|
boolean |
play(String sPlaylist) |
Add a media item to the playlist as defined by an XML file ..
|
boolean |
play(String name,
int start,
int length,
boolean reset) |
Adds a media source item to this playlist -
|
void |
previous() |
|
void |
previous(int n) |
|
boolean |
removeFromPlaylist(int index) |
Remove item from playlist based on index.
|
boolean |
removeFromPlaylist(String name) |
Remove all items matching the given stream name from the playlist.
|
void |
removeListener(IStreamActionNotify listener) |
Remove a listener
|
void |
run() |
Overridden from class Runnable ....
|
void |
setMoveToNextIfLiveStreamMissing(boolean moveToNextIfLiveStreamMissing) |
If true, will move to next playlist item if live stream is missing or is unpublished.
|
void |
setPollingInterval(int pollingInterval) |
Set the polling interval (milliseconds)
|
void |
setRepeat(boolean repeat) |
Use this to make the playlist repeat or not...
|
void |
setSendOnMetadata(boolean sendOnMetadata) |
True if sending onMetadata events
|
void |
setStartLiveOnPreviousBufferTime(long startLiveOnPreviousBufferTime) |
Set time in milliseconds to go back in live stream buffer to get previous key frame
|
void |
setStartLiveOnPreviousKeyFrame(boolean startLiveOnPreviousKeyFrame) |
Set to true to start live streams on most recent key frame (smoother switching)
|
void |
setSwitchLog(boolean switchLog) |
Log when a playlist switch occurs
|
void |
setTimeOffsetBetweenItems(int timeOffsetBetweenItems) |
Set time in milliseconds to add to stream time between playlist items (default is zero)
|
void |
setTimesInMilliseconds(boolean timesInMilliseconds) |
If true start time and duration and are milliseconds.
|
void |
setUnpublishOnEnd(boolean stopOnEnd) |
If true, stop publishing if end of playlist and repeat is false
|
void |
setVODSpeed(double vodSpeed) |
public void addListener(IStreamActionNotify listener)
listener - listenerpublic boolean addToPlaylist(int index,
String name,
int start,
int length)
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)public boolean addToPlaylist(String existing,
String name,
int start,
int length)
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)public void close()
public void closeAndWait()
public static Stream createInstance(IApplicationInstance appInstance, String sName)
appInstance - - Application instancesName - - Name of Streampublic static Stream createInstance(IVHost vhost, String applicationName, String sName)
vhost - - Virtual HostapplicationName - - Application namesName - - Name of Streampublic static Stream createInstance(IVHost vhost, String applicationName, String appInstanceName, String sName)
vhost - - Virtual HostapplicationName - - Application nameappInstanceName - - Instance namesName - - Name of Streampublic static Stream createInstance(IVHost vhost, String applicationName, String appInstanceName, String sName, String streamType)
vhost - - Virtual HostapplicationName - - Application nameappInstanceName - - Instance namesName - - Name of StreamstreamType - - Stream typepublic PlaylistItem getCurrentItem()
public Object getLock()
public String getName()
public java.util.List<PlaylistItem> getPlaylist()
public int getPollingInterval()
public Publisher getPublisher()
public boolean getRepeat()
public long getStartLiveOnPreviousBufferTime()
public String getStreamType()
public int getTimeOffsetBetweenItems()
public double getVODSpeed()
public boolean isMoveToNextIfLiveStreamMissing()
public boolean isSendOnMetadata()
public boolean isStartLiveOnPreviousKeyFrame()
public boolean isSwitchLog()
public boolean isTimesInMilliseconds()
public boolean isUnpublishOnEnd()
public void next()
public void next(int n)
public void play(int n)
public boolean play(String sPlaylist)
sPlaylist - - the playlist XML definition filepublic boolean play(String name,
int start,
int length,
boolean reset)
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
appendedpublic void previous()
public void previous(int n)
public boolean removeFromPlaylist(int index)
index - item indexpublic boolean removeFromPlaylist(String name)
name - stream namepublic void removeListener(IStreamActionNotify listener)
listener - listenerpublic void run()
run in interface Runnablepublic void setMoveToNextIfLiveStreamMissing(boolean moveToNextIfLiveStreamMissing)
moveToNextIfLiveStreamMissing - move to next playlist item if live stream is missing or is unpublishedpublic void setPollingInterval(int pollingInterval)
pollingInterval - polling interval (milliseconds)public void setRepeat(boolean repeat)
repeat - - true to repeat otherwise falsepublic void setSendOnMetadata(boolean sendOnMetadata)
sendOnMetadata - True if sending onMetadata eventspublic void setStartLiveOnPreviousBufferTime(long startLiveOnPreviousBufferTime)
startLiveOnPreviousBufferTime - time in milliseconds to go back in live stream buffer to get previous key framepublic void setStartLiveOnPreviousKeyFrame(boolean startLiveOnPreviousKeyFrame)
startLiveOnPreviousKeyFrame - true to start live streams on most recent key framepublic void setSwitchLog(boolean switchLog)
switchLog - log when a playlist switch occurspublic void setTimeOffsetBetweenItems(int timeOffsetBetweenItems)
timeOffsetBetweenItems - time in milliseconds to add to stream time between playlist itemspublic void setTimesInMilliseconds(boolean timesInMilliseconds)
timesInMilliseconds - true start time and duration and are millisecondspublic void setUnpublishOnEnd(boolean stopOnEnd)
stopOnEnd - stop publishing if end of playlist and repeat is falsepublic void setVODSpeed(double vodSpeed)