Skip to content

Commit

Permalink
Merged in staging (pull request #346)
Browse files Browse the repository at this point in the history
Release 2.1.4
  • Loading branch information
dinawee committed Jun 30, 2020
2 parents 2769db7 + a4920b7 commit a78e0f6
Show file tree
Hide file tree
Showing 548 changed files with 53,160 additions and 60,203 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SKYLINK WEB SDK 2.1.3
# SKYLINK WEB SDK 2.1.4
> Temasys SkylinkJS Web SDK is an open-source client-side library for your web-browser that enables any website to easily leverage the capabilities of WebRTC and its direct data streaming powers between peers for audio/video conferencing or file transfer.
You'll need a Temasys Account, and an App key to use this. [Register here to get your App key](https://console.temasys.io).
Expand Down Expand Up @@ -35,7 +35,7 @@ You'll need a Temasys Account, and an App key to use this. [Register here to get
#### Current versions and stability
- We recommend that you always use the latest versions of the Temasys SkylinkJS Web SDK as WebRTC is still evolving and we adapt to changes very frequently.

[Latest version: 2.1.3](https://github.com/Temasys/SkylinkJS/releases/tag/2.1.3)
[Latest version: 2.1.4](https://github.com/Temasys/SkylinkJS/releases/tag/2.1.4)


## How to build your own Temasys SkylinkJS Web SDK
Expand Down
2 changes: 1 addition & 1 deletion demos/collection/kitchensink/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
</div>
<div id="sample_video_panel" class="panel panel-default hidden">
<div class="panel-heading">Sample Video</div>
<video src="../assets/videos/sampleVideo_10.mp4" id="sampleVideo" class=" " playsinline muted controls></video>
<!-- <video src="../assets/videos/sampleVideo_10.mp4" id="sampleVideo" class=" " playsinline muted controls></video>-->
</div>
<div id="logs_panel" class="panel panel-default">
<div class="panel-body">
Expand Down
48 changes: 34 additions & 14 deletions demos/collection/kitchensink/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ Demo.Methods.toggleInRoomSettings = function(peerId, inRoom) {

// reset joinRoomOptions to handle duplicate tab
$('#join_room_p2p_key').prop('checked', true);
$('#join_room_audio').prop('checked', true);
$('#join_room_audio_muted').prop('checked', false);
$('#join_room_video').prop('checked', true);
$('#join_room_video_muted').prop('checked', false);
// $('#join_room_audio').prop('checked', true);
// $('#join_room_audio_muted').prop('checked', false);
// $('#join_room_video').prop('checked', true);
// $('#join_room_video_muted').prop('checked', false);
} else {
$('#join_room_btn').removeClass('disabled');
$('#presence_list_body').empty();
Expand Down Expand Up @@ -140,17 +140,29 @@ Demo.Methods.updateStreams = function() {
};

Demo.Methods.getMediaStatus = function(type) {
if (!Demo.Streams || !Demo.Streams.userMedia) {
if (!Demo.Streams && !Demo.Streams[_peerId]) {
return { audioMuted: -1, videoMuted: -1 };
}

if (type === 'audio') {
const audioSId = Demo.Skylink.getPeerInfo(config.defaultRoom).mediaStatus[Object.keys(Demo.Streams.userMedia).filter((sId) => { return Demo.Streams.userMedia[sId].getAudioTracks().length > 0 })]
return audioSId ? audioSId: { audioMuted: -1, videoMuted: -1 };
let audioSId = '';
if (Demo.Streams[_peerId].streams.audio) {
audioSId = Demo.Skylink.getPeerInfo(config.defaultRoom).mediaStatus[Object.keys(Demo.Streams[_peerId].streams.audio)[0]]
}

return audioSId ? audioSId : { audioMuted: -1, videoMuted: -1 };
}

if (type === 'video') {
const videoSId = Demo.Skylink.getPeerInfo(config.defaultRoom).mediaStatus[Object.keys(Demo.Streams.userMedia).filter((sId) => { return Demo.Streams.userMedia[sId].getVideoTracks().length > 0 })]
let videoSId = '';
if (Demo.Streams[_peerId].streams.video) {
videoSId = Demo.Skylink.getPeerInfo(config.defaultRoom).mediaStatus[Object.keys(Demo.Streams[_peerId].streams.video)[0]]
}

if (!videoSId && Demo.Streams[_peerId].screenShare) {
videoSId = Demo.Skylink.getPeerInfo(config.defaultRoom).mediaStatus[Object.keys(Demo.Streams[_peerId].stream.screenShare)[0]];
}

return videoSId ? videoSId: { audioMuted: -1, videoMuted: -1 };
}
};
Expand Down Expand Up @@ -227,6 +239,17 @@ SkylinkEventManager.addEventListener(SkylinkConstants.EVENTS.PEER_JOINED, (evt)
newListEntry += '</td></tr>';
$('#presence_list').append(newListEntry);
$('#user' + peerId + ' .0').css('color', 'green');

// LOGGING
setTimeout(() => {
console.log("***** START *****")
console.log("getPeersCustomSettings", Demo.Skylink.getPeersCustomSettings(config.defaultRoom));
console.log("getPeerInfo", Demo.Skylink.getPeerInfo(config.defaultRoom, peerId));
console.log("getPeersDataChannels", Demo.Skylink.getPeersDataChannels(config.defaultRoom));
console.log("getStreams", Demo.Skylink.getStreams(config.defaultRoom));
console.log("getUserData", Demo.Skylink.getUserData(config.defaultRoom));
console.log("***** END *****")
}, 5000);
}

// create the peer video element
Expand Down Expand Up @@ -317,8 +340,8 @@ SkylinkEventManager.addEventListener(SkylinkConstants.EVENTS.PEER_UPDATED, (evt)
let audioStreamId = null;
let videoStreamId = null;

if (Demo.Streams && Demo.Streams.screenshare) {
streamIds = streamIds.filter((id) => id !== Demo.Streams.screenshare.id)
if (Demo.Streams && Demo.Streams[_peerId] && Demo.Streams[_peerId].streams.screenShare) {
streamIds = streamIds.filter((id) => id !== Object.keys(Demo.Streams[_peerId].streams.screenShare)[0]);
}

if (streamIds[0] && streamIds[1]) {
Expand Down Expand Up @@ -392,9 +415,6 @@ SkylinkEventManager.addEventListener(SkylinkConstants.EVENTS.ON_INCOMING_STREAM,
}
} else {
$('#user' + peerId + ' .name').html(peerInfo.userData);
setTimeout(() => {
console.log(Demo.Skylink.getPeersCustomSettings(config.defaultRoom));
}, 5000);
}

if (Demo.ShowStats[peerId]) {
Expand Down Expand Up @@ -915,7 +935,7 @@ $(document).ready(function() {
});
// //---------------------------------------------------
$('#stop_stream_btn').click(function() {
if (Demo.Streams && Demo.Streams.userMedia) {
if (Demo.Streams && (Demo.Streams[_peerId].streams.audio || Demo.Streams[_peerId].streams.video)) {
Demo.Skylink.stopStreams(config.defaultRoom)
.then(() => console.log("stopStreams resolved"))
.catch((err) => console.error("stopStreams rejected", err));
Expand Down
Loading

0 comments on commit a78e0f6

Please sign in to comment.