Cookie CSS

Saturday, May 20, 2017

Skype Web SDK - Part VIII

What is the Skype Web SDK?

The Skype Developer Platform for Web ("Skype Web SDK") is a set of JavaScript Web APIs and HTML controls that enable you to build web experiences that seamlessly integrate a wide variety of real-time collaboration models leveraging Skype for Business services and the larger Skype network. It provides support for multiple core collaboration services like presence, chat, audio, and video, enabling web experiences across a broad spectrum of users, platforms, and devices.



Today's Topic : Handling and Incoming Video Call

Today we will look at how to handling an incoming video call.  The task is accomplished using the conversationsManager object.  It's pretty simple, there are 2 choice either accept or reject the incoming call.  Here is our sample code;

var conversationsManager = application.conversationsManager; conversationsManager.conversations.added(function (conversation) { conversation.videoService.accept.enabled.when(true, function () { if (showModal('Accept incoming video invitation?')) { conversation.videoService.accept(); conversation.participants.added(function (person) { // person.displayName() has joined the conversation person.video.state.when('Connected', function () { // set up remote video container person.video.channels(0).stream.source.sink.format('Stretch'); person.video.channels(0).stream.source.sink.container(/* DOM node */); }); }); } else { conversation.videoService.reject(); } }); conversation.selfParticipant.video.state.when('Connected', function () { // set up remote video container conversation.selfParticipant.video.channels(0).stream.source.sink.format('Stretch'); conversation.selfParticipant.video.channels(0).stream.source.sink.container(/* DOM node */); }); conversation.state.changed(function (newValue, reason, oldValue) { if (newValue === 'Disconnected' && (oldValue === 'Connected' || oldValue === 'Connecting')) { // conversation ended } }); });


When we are done with the call we simply call the code below to end it.

conversation.leave().then(function () { // conversation ended }, function (error) { // handle error }).then(function () { // clean up operations });


Next week week we'll look at how to escalate a call.

Doug Routledge, C# Lync, Skype for Business, SQL, Exchange, UC, 
Full Stack Developer  BridgeOC Bridge Operator Console
Twitter - @droutledge @ndbridge