当前位置: 首页>>代码示例>>Java>>正文


Java IConnection.getStreamId方法代码示例

本文整理汇总了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);
            }
        }
    }
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:29,代码来源:StreamService.java

示例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);
                }
            }
        }
    }
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:27,代码来源:StreamService.java

示例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);
            }
        }
    }
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:19,代码来源:StreamService.java

示例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();
            }
        }
    }
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:16,代码来源:StreamService.java

示例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);
        }
    }
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:14,代码来源:StreamService.java

示例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);
        }
    }
}
 
开发者ID:Red5,项目名称:red5-server-common,代码行数:14,代码来源:StreamService.java


注:本文中的org.red5.server.api.IConnection.getStreamId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。