diff --git a/CHANGES.txt b/CHANGES.txt index ae3c9e75..bd59141f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,5 +1,8 @@ Change List ========= +Version 3.1.48 (Build 2021062800) +- added screen recorder + Version 3.1.47 (Build 2021061100) -updated native video template -tweaked the file extension parser in uploader.js diff --git a/amd/src/dlg_devicesettings.js b/amd/src/dlg_devicesettings.js index d54b9818..5a72fdbe 100644 --- a/amd/src/dlg_devicesettings.js +++ b/amd/src/dlg_devicesettings.js @@ -31,6 +31,11 @@ define(['jquery', 'core/log', 'filter_poodll/dlg_poodll'], function ($, log, dia this.dlgbox = dlgbox; this.dlg.set_dialogue_box(dlgbox); + }, + set_media_type: function (mediatype) { + //used by screen recorder skin to overide default media type in order to not show video + this.mediatype = mediatype; + }, open: function () { var self = this; @@ -67,7 +72,7 @@ define(['jquery', 'core/log', 'filter_poodll/dlg_poodll'], function ($, log, dia //register events for the select boxes self.registerEvents(); - if (self.instanceprops.config.mediatype == 'video') { + if (self.mediatype == 'video') { self.dlg.onclose = function () { self.resetVideoUserInterface(); }; diff --git a/amd/src/poodll_mediarecorder.js b/amd/src/poodll_mediarecorder.js index e329ecb5..a4f654b8 100644 --- a/amd/src/poodll_mediarecorder.js +++ b/amd/src/poodll_mediarecorder.js @@ -160,8 +160,8 @@ define(['jquery', 'core/log', 'filter_poodll/utils_amd', this.register_events_video(controlbarid); - //if this is the uploader skin, then we do not bother to get mediaDevices - if (ip.config.media_skin == 'upload' || ip.config.media_skin == 'warning') { + //if this is any of the uploader/warning/screen skins, then we do not bother to get mediaDevices + if (ip.config.media_skin == 'upload' || ip.config.media_skin == 'warning' || ip.config.media_skin == 'screen') { break; } @@ -279,6 +279,7 @@ define(['jquery', 'core/log', 'filter_poodll/utils_amd', }, + warmup_context: function (ip) { var ctx = ip.audioctx; //for chrome oct 2018 @@ -336,6 +337,49 @@ define(['jquery', 'core/log', 'filter_poodll/utils_amd', }); }, + + + do_start_screen: function (ip, onMediaSuccess) { + + var that = this; + // we warm up the context object + this.warmup_context(ip); + + // warmup. the preview object + this.warmup_preview(ip); + + //mute the preview + ip.controlbar.preview[0].muted=true; + + ip.blobs = []; + //get media constraints + var mediaConstraints = { + audio: {'echoCancellation': true}, + video: {cursor: "motion"} + }; + + //set aspect ratio and I think the "exact" below should be "ideal" + // mediaConstraints.video = {aspectRatio: 1920/1080}; + + + //do all our stream stuff + navigator.mediaDevices.getDisplayMedia(mediaConstraints) + .then(async function(displayStream){ + // check for a user audio selected device + if (ip.useraudiodeviceid) { + var audiodeviceid = ip.useraudiodeviceid.valueOf(); + mediaConstraints.audio.deviceId = audiodeviceid ? {exact: audiodeviceid} : undefined; + } + var voiceStream = await navigator.mediaDevices.getUserMedia({ audio: mediaConstraints.audio, video: false }); + var tracks = [...displayStream.getTracks(), ...voiceStream.getAudioTracks()] + var stream = new MediaStream(tracks); + onMediaSuccess(stream); + }) + .catch(function (e) { + that.onMediaError(e, ip); + }); + }, + do_start_video: function (ip, onMediaSuccess) { }, @@ -448,7 +492,10 @@ define(['jquery', 'core/log', 'filter_poodll/utils_amd', ip.config.hermes.postMessage(messageObject); }, do_stop_video: function (ip) { - + //just use do_stop_audio + }, + do_stop_screen: function (ip) { + //just use do_stop_audio }, do_pause_audio: function (ip) { //if its paused we need to resume it before pausing again. @@ -466,7 +513,7 @@ define(['jquery', 'core/log', 'filter_poodll/utils_amd', }, - /* fetch the audio constraints for passing to mediastream */ + /* fetch the video constraints for passing to mediastream */ fetch_video_constraints: function (ip) { var mediaConstraints = { audio: !utils.is_opera() && !utils.is_edge(), @@ -493,6 +540,33 @@ define(['jquery', 'core/log', 'filter_poodll/utils_amd', return mediaConstraints; }, + /* fetch the screen constraints for passing to mediastream */ + fetch_screen_constraints: function (ip) { + var mediaConstraints = { + audio: !utils.is_opera() && !utils.is_edge(), + video: true + }; + + //set aspect ratio and I think the "exact" below should be "ideal" + // mediaConstraints.video = {aspectRatio: 1920/1080}; + //alert('set'); + + // check for a user video selected device + if (ip.uservideodeviceid) { + var videodeviceid = ip.uservideodeviceid.valueOf(); + var constraints = {deviceId: videodeviceid ? {exact: videodeviceid} : undefined}; + + mediaConstraints.video = constraints; + } + // check for a user audio selected device + if (ip.useraudiodeviceid) { + var audiodeviceid = ip.useraudiodeviceid.valueOf(); + var constraints = {deviceId: audiodeviceid ? {exact: audiodeviceid} : undefined}; + mediaConstraints.audio = constraints; + } + return mediaConstraints; + }, + /* fetch the audio constraints for passing to mediastream */ fetch_audio_constraints: function (ip) { diff --git a/amd/src/poodll_mediaskins.js b/amd/src/poodll_mediaskins.js index 9cd80a17..296c4bba 100644 --- a/amd/src/poodll_mediaskins.js +++ b/amd/src/poodll_mediaskins.js @@ -13,7 +13,10 @@ define(['jquery', 'core/log', 'filter_poodll/poodll_oncemediaskin', 'filter_poodll/poodll_freshmediaskin', 'filter_poodll/poodll_uploadmediaskin', - 'filter_poodll/poodll_warningmediaskin'], function ($, log, baseskin, onetwothreeskin, goldskin, bmrskin, shadowskin, splitskin, fluencybuilderskin, pushskin, readaloudskin, readseedskin, onceskin, freshskin, uploadskin, warningskin) { + 'filter_poodll/poodll_screenmediaskin', + 'filter_poodll/poodll_warningmediaskin'], + function ($, log, baseskin, onetwothreeskin, goldskin, bmrskin, shadowskin, splitskin, fluencybuilderskin, + pushskin, readaloudskin, readseedskin, onceskin, freshskin, uploadskin, screenskin, warningskin) { "use strict"; // jshint ;_; @@ -64,6 +67,9 @@ define(['jquery', 'core/log', case 'upload': the_skin = uploadskin.clone(); break; + case 'screen': + the_skin = screenskin.clone(); + break; case 'warning': the_skin = warningskin.clone(); break; diff --git a/amd/src/poodll_onetwothreemediaskin.js b/amd/src/poodll_onetwothreemediaskin.js index 112e755e..f29d7a8b 100644 --- a/amd/src/poodll_onetwothreemediaskin.js +++ b/amd/src/poodll_onetwothreemediaskin.js @@ -1,4 +1,6 @@ -define(['jquery', 'jqueryui', 'core/log', 'filter_poodll/utils_amd', 'filter_poodll/anim_progress_bar', 'filter_poodll/speech_poodll', 'filter_poodll/dlg_devicesettings', 'filter_poodll/upskin_bar'], function ($, jqui, log, utils, anim_progress_bar, browserrecognition, settings, upskin_bar) { +define(['jquery', 'jqueryui', 'core/log', 'filter_poodll/utils_amd', 'filter_poodll/anim_progress_bar', + 'filter_poodll/speech_poodll', 'filter_poodll/dlg_devicesettings', 'filter_poodll/upskin_bar'], + function ($, jqui, log, utils, anim_progress_bar, browserrecognition, settings, upskin_bar) { /* jshint ignore:start */ "use strict"; // jshint ;_; @@ -278,15 +280,16 @@ define(['jquery', 'jqueryui', 'core/log', 'filter_poodll/utils_amd', 'filter_poo controls += '