【问题标题】:Anonymous meeting join - Skype UCWA for online匿名会议加入 - Skype UCWA 在线
【发布时间】:2016-07-12 07:22:07
【问题描述】:

我正在尝试通过会议 URI 匿名加入会议,但这似乎不起作用。我访问了 SKYPE UCWA 站点并访问了交互式 SDK - 并尝试从那里匿名加入会议,但该页面没有执行任何操作。

https://ucwa.skype.com/websdk

下面是我尝试匿名加入会议的代码,但对 client.signInManager.signIn 的调用从未完成,也没有引发任何异常。

寻找解决此问题的建议。另外,如果有人有使用 SKYPE web sdk (UCWA) 匿名加入会议的工作代码,请分享。谢谢。

function InitialiseSkype() {
                Skype.initialize({ apiKey: config.apiKey }, function (api) {
                window.skypeWebAppCtor = api.application;
                window.skypeWebApp = new api.application();
                client = new window.skypeWebAppCtor;
                //once intialised, sign in
                           
                alert("Skype SDK Initialized");
                JoinAnonymous();
                
            }, function (err) {
                console.log(err);
                alert('Cannot load the SDK.');
            });
        } 

function JoinAnonymous(){
client.signInManager.signIn({
                version: config.Version,
                name: $('#name').val(),
                meeting: $('#meetingUri').val()
            }).then(function () {
                alert('Signed In, Anonymously');
                var conversation = application.conversationsManager.getConversationByUri(uri);
            }, function (error) {
                alert(error);
            }); 
}

【问题讨论】:

    标签: skype-for-business ucwa


    【解决方案1】:

    实际上我确实使用该代码匿名登录:

    //Init
        var config = {apiKey: 'a42fcebd-5b43-4b89-a065-74450fb91255', // SDK
                     apiKeyCC: '9c967f6b-a846-4df2-b43d-5167e47d81e1' // SDK+UI
                     };
    
         Skype.initialize({ apiKey: config.apiKey }, function (api) {
             window.skypeWebApp =  new api.application; 
        }, function (err) {
            console.log("cannot load the sdk package", err);
          }); 
    
    //Actual code
        var uri ="sip:xxxxxxxx;gruu;opaque=app:conf:focus:id:xxxxxxxx";
        window.skypeWebApp.signInManager.signIn({
          name: "pseudo",
          meeting:uri
        }).then(function () {
          alert('Signed In, Anonymously');
    
        }, function (error) {
          alert(error);
        });

    我确实连接了 ucwa.skype 交互式 web sdk 页面中给出的 uri。 但在那之后我没有设法加入对话,可能是因为交互式示例并没有真正创建房间。

    我可以在使用示例帐户登录时从 office365 帐户加入会议。但是我不能匿名加入我的会议室。 您尝试使用本地帐户还是 office365 帐户?

    【讨论】:

    • 感谢 Lemni 的回复。问题出在 Skype for Business Online 上。我现在了解到的是,SFB online 尚不支持匿名会议加入。
    • 我认为SFB在线的支持还没有很好的定义。您实际上可以使用 ucwa 使用在线帐户登录,但不能直接使用 Skype web sdk 工具登录……因此,不支持匿名会议似乎是合乎逻辑的……
    【解决方案2】:

    Skype For Business Online 似乎无法匿名加入会议。

    【讨论】:

      【解决方案3】:

      WebSDK 的新更新现在支持 SfB Online 的匿名会议加入

      (function () {
          'use strict';
      
          // this will be populated when the auth token is fetched
          // it is later needed to sign into Skype for Business
          var authDetails = {};
      
          // A reference to the Skype SDK application object
          // set during initialization
          var app;
      
          displayStep(0);
          registerUIListeners();
      
          // Initializing the Skype application
          Skype.initialize({
              apiKey: '9c967f6b-a846-4df2-b43d-5167e47d81e1'
          }, function (api) {
              console.log('Skype SDK initialization successful');
      
              app = api.UIApplicationInstance;
      
              // Once it is initialized, display a UI prompt for a meeting URL
              displayStep(1);
          }, function (err) {
              console.error('Skype SDK initialization error:', err);
          });
      
          // After the user submits the meeting URL the next step is to 
          // fetch an auth token
          function getToken(evt) {
              var input = evt.target.querySelector('input'),
                  meetingUrl = input.value,
                  request = new XMLHttpRequest(),
                  data;
      
              evt.preventDefault();
              console.log('Fetching auth token from meeting url:', meetingUrl);
      
              function guid() {
                  function s4() {
                      return Math.floor((1 + Math.random()) * 0x10000)
                      .toString(16)
                      .substring(1);
                  }
                  return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
                      s4() + '-' + s4() + s4() + s4();
              }
      
              var sessionId = guid();
              data = 'ApplicationSessionId=' + sessionId +
                  '&AllowedOrigins=' + encodeURIComponent(window.location.href) +
                  '&MeetingUrl=' + encodeURIComponent(meetingUrl);
      
              request.onreadystatechange = function () {
                  if (request.readyState === XMLHttpRequest.DONE) {
                      if (request.status === 200) {
                          var response = JSON.parse(request.response);
      
                          authDetails.discoverUrl = response.DiscoverUri;
                          authDetails.authToken = "Bearer " + response.Token;
      
                          console.log('Successfully fetched the anonymous auth token and discoverUrl', authDetails);
                          displayStep(2);
                      }
                      else {
                          console.error('An error occured, fetching the anonymous auth token', request.responseText);
                      }
                  }
              };
      
              request.open('post', 'http://webrtctest.cloudapp.net/getAnonTokenJob');
              request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
              request.send(data);
          }
      
          // This uses the auth token and discovery URL to sign into Skype
          // and join the meeting
          function joinAVMeeting(evt) {
              var input = evt.target.querySelector('input'),
                  name = input.value;
      
              evt.preventDefault();
              console.log('Joinig meeting as:', name);
      
              app.signInManager.signIn({
                  name: name,
                  cors: true,
                  root: { user: authDetails.discoverUrl },
                  auth: function (req, send) {
                      // Send token with all requests except for the GET /discover
                      if (req.url != authDetails.discoverUrl)
                          req.headers['Authorization'] = authDetails.authToken;
                      return send(req);
                  }
              }).then(function () {
                  // When joining a conference anonymously, the SDK automatically creates
                  // a conversation object to represent the conference being joined
                  var conversation = app.conversationsManager.conversations(0);
      
                  console.log('Successfully signed in with anonymous online meeting token');
      
                  registerAppListeners(conversation);
      
                  // This turns on local video and joins the meeting
                  startVideoService(conversation);
      
              }).catch(function (error) {
                  console.error('Unable to join conference anonymously:', error);
              });
      
      
              function registerAppListeners(conversation) {
                  conversation.selfParticipant.video.state.when('Connected', function () {
      
                      console.log('Showing self video');
      
                      document.querySelector('.self').style.display = 'inline-block';
                      setupContainer(conversation.selfParticipant.video.channels(0), document.querySelector('.self .video'));
                      displayName(document.querySelector('.self'), conversation.selfParticipant);
      
                      console.log('The video mode of the application is:', conversation.videoService.videoMode());
      
                      if (conversation.videoService.videoMode() === 'MultiView') {
                          // Loading the sample in any other browser than Google Chrome means that 
                          // the videoMode is set to 'MultiView'
                          // Please refer to https://msdn.microsoft.com/en-us/skype/websdk/docs/ptvideogroup
                          // on an example on how to implement group video.
                      }
      
                      // When in active speaker mode only one remote channel is available.
                      // To display videos of multiple remote parties the video in this one channel
                      // is switched out automatically, depending on who is currently speaking
                      if (conversation.videoService.videoMode() === 'ActiveSpeaker') {
                          var activeSpeaker = conversation.videoService.activeSpeaker;
      
                          setupContainer(activeSpeaker.channel, document.querySelector('.remote .video'));
      
                          activeSpeaker.channel.isVideoOn.when(true, function () {
                              document.querySelector('.remote').style.display = 'inline-block';
                              activeSpeaker.channel.isStarted(true);
      
                              console.log('ActiveSpeaker video is available and has been turned on.');
                          });
      
                          activeSpeaker.channel.isVideoOn.when(false, function () {
                              document.querySelector('.remote').style.display = 'none';
                              activeSpeaker.channel.isStarted(false);
      
                              console.log('ActiveSpeaker video is not available anymore and has been turned off.');
                          });
      
                          // the .participant object changes when the active speaker changes
                          activeSpeaker.participant.changed(function (newValue, reason, oldValue) {
                              console.log('The ActiveSpeaker has changed. Old ActiveSpeaker:', oldValue && oldValue.displayName(), 'New ActiveSpeaker:', newValue && newValue.displayName());
      
                              if (newValue) {
                                  displayName(document.querySelector('.remote'), newValue);
                              }
                          });
                      }
                  });
      
                  conversation.state.changed(function (newValue, reason, oldValue) {
                      if (newValue === 'Disconnected' && (oldValue === 'Connected' || oldValue === 'Connecting')) {
                          console.log('The conversation has ended.');
                          reset();
                      }
                  });
              }
      
              function setupContainer(videoChannel, videoDiv) {
                  videoChannel.stream.source.sink.format('Stretch');
                  videoChannel.stream.source.sink.container(videoDiv);
              }
      
              function displayName(container, person) {
                  container.querySelector('.displayName .detail').innerHTML = person.displayName();
              }
      
              function startVideoService(conversation) {
                  conversation.videoService.start().then(null, function (error) {
                      console.error('An error occured joining the conversation:', error);
                  });
                  displayStep(3);
              }
          }
      
          function endConversation(evt) {
              var conversation = app.conversationsManager.conversations(0);
      
              evt.preventDefault();
      
              conversation.leave().then(function () {
                  console.log('The conversation has ended.');
                  reset();
              }, function (error) {
                  console.error('An error occured ending the conversation:', error);
              }).then(function () {
                  reset();
              });
          }
      
      
          //-----------------------------------------------------------------------
          //UI helper functions
          function displayStep(step) {
              var nodes = document.querySelectorAll('.step');
      
              for (var i = 0; i < nodes.length; ++i) {
                  var node = nodes[i];
      
                  node.style.display = 'none';
      
                  if (i === step) {
                      node.style.display = 'block';
                  }
              }
          }
      
          function registerUIListeners() {
              document.querySelector('.step1').onsubmit = getToken;
              document.querySelector('.step2').onsubmit = joinAVMeeting;
              document.querySelector('.step3').onsubmit = endConversation;
          }
      
          function reset() {
              window.location = window.location.href;
          }
      
      })();
      

      https://github.com/OfficeDev/skype-docs/blob/master/Skype/WebSDK/samples/Meetings/Anonymous%20Online/standalone/index.js

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2023-03-07
        • 2016-10-15
        • 2017-04-17
        • 2023-03-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多