コード例 #1
0
ファイル: GCPAPI.cpp プロジェクト: Bayerner/webrtc_plugin
void GCPAPI::SetRemoteDescription(const FB::variant& action,
                                  const FB::variant& sdp,
                                  const FB::JSObjectPtr& succCb,
                                  const FB::JSObjectPtr& failCb)
{
    GoCast::RtcCenter* pCtr = GoCast::RtcCenter::Instance();
    m_onsetsdpsuccessCb = succCb;
    m_onsetsdpfailureCb = failCb;
    
    if(false == pCtr->Inited())
    {
        std::string msg = m_htmlId.convert_cast<std::string>();
        msg += ": Failed to init RtcCenter singleton...";
        FBLOG_ERROR_CUSTOM("GCPAPI::SetRemoteDescription", msg);
        
        if(NULL != failCb.get())
        {
            failCb->InvokeAsync("", FB::variant_list_of("RtcCenter init failed"));
        }
        return;
    }
    
    pCtr->SetRemoteDescription(m_htmlId.convert_cast<std::string>(),
                               m_pSetRemoteSDPObserver,
                               action.convert_cast<std::string>(),
                               sdp.convert_cast<std::string>());
}
コード例 #2
0
ファイル: GCPAPI.cpp プロジェクト: Bayerner/webrtc_plugin
void GCPAPI::GetUserMedia(const FB::JSObjectPtr& mediaHints,
                          const FB::JSObjectPtr& succCb,
                          const FB::JSObjectPtr& failCb)
{
    GoCast::RtcCenter* pCtr = GoCast::RtcCenter::Instance();
	m_htmlId = "localPlayer";
    
    if(false == pCtr->Inited())
    {
        std::string msg = m_htmlId.convert_cast<std::string>();
        msg += ": Failed to init RtcCenter singleton...";
        FBLOG_ERROR_CUSTOM("GCPAPI::GetUserMedia", msg);
        
        if(NULL != failCb.get())
        {
            failCb->InvokeAsync("", FB::variant_list_of("RtcCenter init failed"));
        }
        return;
    }
    
    pCtr->GetUserMedia(mediaHints, succCb, failCb, false);
}