本文整理汇总了Java中org.red5.server.api.IConnection.getStreamId方法的典型用法代码示例。如果您正苦于以下问题:Java IConnection.getStreamId方法的具体用法?Java IConnection.getStreamId怎么用?Java IConnection.getStreamId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.red5.server.api.IConnection
的用法示例。
在下文中一共展示了IConnection.getStreamId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: pause
import org.red5.server.api.IConnection; //导入方法依赖的package包/类
/**
* Pause at given position. Required as "pausePlayback" can be "null" if no flag is passed by the client
*
* @param pausePlayback
* Pause playback or not
* @param position
* Pause position
*/
public void pause(Boolean pausePlayback, int position) {
IConnection conn = Red5.getConnectionLocal();
if (conn instanceof IStreamCapableConnection) {
IStreamCapableConnection streamConn = (IStreamCapableConnection) conn;
Number streamId = conn.getStreamId();
IClientStream stream = streamConn.getStreamById(streamId);
if (stream != null && stream instanceof ISubscriberStream) {
ISubscriberStream subscriberStream = (ISubscriberStream) stream;
// pausePlayback can be "null" if "pause" is called without any parameters from flash
if (pausePlayback == null) {
pausePlayback = !subscriberStream.isPaused();
}
if (pausePlayback) {
subscriberStream.pause(position);
} else {
subscriberStream.resume(position);
}
}
}
}
示例2: publish
import org.red5.server.api.IConnection; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void publish(Boolean dontStop) {
// null is as good as false according to Boolean.valueOf() so if null, interpret as false
if (dontStop == null || !dontStop) {
IConnection conn = Red5.getConnectionLocal();
if (conn instanceof IStreamCapableConnection) {
IStreamCapableConnection streamConn = (IStreamCapableConnection) conn;
Number streamId = conn.getStreamId();
IClientStream stream = streamConn.getStreamById(streamId);
if (stream instanceof IBroadcastStream) {
IBroadcastStream bs = (IBroadcastStream) stream;
if (bs.getPublishedName() != null) {
IBroadcastScope bsScope = getBroadcastScope(conn.getScope(), bs.getPublishedName());
if (bsScope != null) {
bsScope.unsubscribe(bs.getProvider());
if (conn instanceof BaseConnection) {
((BaseConnection) conn).unregisterBasicScope(bsScope);
}
}
bs.close();
streamConn.deleteStreamById(streamId);
}
}
}
}
}
示例3: seek
import org.red5.server.api.IConnection; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void seek(int position) {
log.trace("seek - position:{}", position);
IConnection conn = Red5.getConnectionLocal();
if (conn instanceof IStreamCapableConnection) {
IStreamCapableConnection streamConn = (IStreamCapableConnection) conn;
Number streamId = conn.getStreamId();
IClientStream stream = streamConn.getStreamById(streamId);
if (stream != null && stream instanceof ISubscriberStream) {
ISubscriberStream subscriberStream = (ISubscriberStream) stream;
try {
subscriberStream.seek(position);
} catch (OperationNotSupportedException err) {
sendNSFailed(streamConn, StatusCodes.NS_SEEK_FAILED, "The stream doesn't support seeking.", stream.getName(), streamId);
}
}
}
}
示例4: play
import org.red5.server.api.IConnection; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void play(Boolean dontStop) {
log.debug("Play without stop: {}", dontStop);
if (!dontStop) {
IConnection conn = Red5.getConnectionLocal();
if (conn instanceof IStreamCapableConnection) {
IStreamCapableConnection streamConn = (IStreamCapableConnection) conn;
Number streamId = conn.getStreamId();
IClientStream stream = streamConn.getStreamById(streamId);
if (stream != null) {
stream.stop();
}
}
}
}
示例5: receiveVideo
import org.red5.server.api.IConnection; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void receiveVideo(boolean receive) {
IConnection conn = Red5.getConnectionLocal();
if (conn instanceof IStreamCapableConnection) {
IStreamCapableConnection streamConn = (IStreamCapableConnection) conn;
Number streamId = conn.getStreamId();
IClientStream stream = streamConn.getStreamById(streamId);
if (stream != null && stream instanceof ISubscriberStream) {
ISubscriberStream subscriberStream = (ISubscriberStream) stream;
subscriberStream.receiveVideo(receive);
}
}
}
示例6: receiveAudio
import org.red5.server.api.IConnection; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void receiveAudio(boolean receive) {
IConnection conn = Red5.getConnectionLocal();
if (conn instanceof IStreamCapableConnection) {
IStreamCapableConnection streamConn = (IStreamCapableConnection) conn;
Number streamId = conn.getStreamId();
IClientStream stream = streamConn.getStreamById(streamId);
if (stream != null && stream instanceof ISubscriberStream) {
ISubscriberStream subscriberStream = (ISubscriberStream) stream;
subscriberStream.receiveAudio(receive);
}
}
}