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


Java JingleSessionListener类代码示例

本文整理汇总了Java中org.jivesoftware.smackx.jingleold.listeners.JingleSessionListener的典型用法代码示例。如果您正苦于以下问题:Java JingleSessionListener类的具体用法?Java JingleSessionListener怎么用?Java JingleSessionListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JingleSessionListener类属于org.jivesoftware.smackx.jingleold.listeners包,在下文中一共展示了JingleSessionListener类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: triggerSessionClosed

import org.jivesoftware.smackx.jingleold.listeners.JingleSessionListener; //导入依赖的package包/类
/**
 * Trigger a session closed event.
 */
protected void triggerSessionClosed(String reason) {
    //        for (ContentNegotiator contentNegotiator : contentNegotiators) {
    //
    //            contentNegotiator.stopJingleMediaSession();
    //
    //            for (TransportCandidate candidate : contentNegotiator.getTransportNegotiator().getOfferedCandidates())
    //                candidate.removeCandidateEcho();
    //        }

    List<JingleListener> listeners = getListenersList();
    for (JingleListener li : listeners) {
        if (li instanceof JingleSessionListener) {
            JingleSessionListener sli = (JingleSessionListener) li;
            sli.sessionClosed(reason, this);
        }
    }
    close();
}
 
开发者ID:TTalkIM,项目名称:Smack,代码行数:22,代码来源:JingleSession.java

示例2: triggerSessionClosedOnError

import org.jivesoftware.smackx.jingleold.listeners.JingleSessionListener; //导入依赖的package包/类
/**
 * Trigger a session closed event due to an error.
 */
protected void triggerSessionClosedOnError(XMPPException exc) {
    for (ContentNegotiator contentNegotiator : contentNegotiators) {

        contentNegotiator.stopJingleMediaSession();

        for (TransportCandidate candidate : contentNegotiator.getTransportNegotiator().getOfferedCandidates())
            candidate.removeCandidateEcho();
    }
    List<JingleListener> listeners = getListenersList();
    for (JingleListener li : listeners) {
        if (li instanceof JingleSessionListener) {
            JingleSessionListener sli = (JingleSessionListener) li;
            sli.sessionClosedOnError(exc, this);
        }
    }
    close();
}
 
开发者ID:TTalkIM,项目名称:Smack,代码行数:21,代码来源:JingleSession.java

示例3: triggerMediaReceived

import org.jivesoftware.smackx.jingleold.listeners.JingleSessionListener; //导入依赖的package包/类
/**
 * Trigger a media received event.
 */
protected void triggerMediaReceived(String participant) {
    List<JingleListener> listeners = getListenersList();
    for (JingleListener li : listeners) {
        if (li instanceof JingleSessionListener) {
            JingleSessionListener sli = (JingleSessionListener) li;
            sli.sessionMediaReceived(this, participant);
        }
    }
}
 
开发者ID:TTalkIM,项目名称:Smack,代码行数:13,代码来源:JingleSession.java

示例4: triggerContentEstablished

import org.jivesoftware.smackx.jingleold.listeners.JingleSessionListener; //导入依赖的package包/类
/**
 * Trigger a session established event.
 * @throws NotConnectedException 
 */
private void triggerContentEstablished(PayloadType pt, TransportCandidate rc, TransportCandidate lc) throws NotConnectedException {

    // Let the session know that we've established a content/media segment.
    JingleSession session = getSession();
    if (session != null) {
        List<JingleListener> listeners = session.getListenersList();
        for (JingleListener li : listeners) {
            if (li instanceof JingleSessionListener) {
                JingleSessionListener sli = (JingleSessionListener) li;
                sli.sessionEstablished(pt, rc, lc, session);
            }
        }
    }

    // Create a media session for each media manager in the session.
    if (mediaNeg.getMediaManager() != null) {
        rc.removeCandidateEcho();
        lc.removeCandidateEcho();

        jingleMediaSession = getMediaNegotiator().getMediaManager().createMediaSession(pt, rc, lc, session);
        jingleMediaSession.addMediaReceivedListener(session);
        if (jingleMediaSession != null) {

            jingleMediaSession.startTrasmit();
            jingleMediaSession.startReceive();

            for (TransportCandidate candidate : getTransportNegotiator().getOfferedCandidates())
                candidate.removeCandidateEcho();
        }
        JingleMediaManager mediaManager = getMediaNegotiator().getMediaManager();
        getSession().addJingleMediaSession(mediaManager.getName(), jingleMediaSession);
    }

}
 
开发者ID:TTalkIM,项目名称:Smack,代码行数:39,代码来源:ContentNegotiator.java


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