You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The setAudioInput method raises "player is not defined" exception when used in a mode different from the AUDIO_ONLY one.
The problematic code is the default case (videojs.record.js::Record.setAudioOutput) that expects global player to exist:
setAudioOutput(deviceId) {
let errorMessage;
switch (this.getRecordType()) {
case AUDIO_ONLY:
// use wavesurfer
(...)
default:
let element = player.tech_.el_;
(...)
b) videoinput to audiooutput in the enumerateReady handler's body:
if (deviceInfo.kind === 'audiooutput') {
c) setVideoInput to setAudioOutput in the changeVideoInput method:
player.record().setAudioOutput(deviceId);
d) rename player to something else, like myplayer
var myplayer = videojs(...)
The thing is that we don't want to create a global player here. In my case I use videojs-record with JS bundler and have no globals like that.
Results
Expected
Output device is changed to the newly selected one
Actual
Output device is not changed and an exception is raised due to the player being undefined
Error output
ReferenceError: player is not defined
setAudioOutput http://localhost:8082/dist/videojs.record.js:3449
changeVideoInput http://localhost:8082/change-audio-output-audiovideo-mode.html:134
Description
The
setAudioInput
method raises "player is not defined" exception when used in a mode different from the AUDIO_ONLY one.The problematic code is the
default
case (videojs.record.js::Record.setAudioOutput
) that expects globalplayer
to exist:Steps to reproduce
I. Start with the "Change video input" example: https://github.com/collab-project/videojs-record/blob/master/examples/change-video-input.html
II. Change:
a)
plugins.record.audio: false
toplugins.record.audio: true
in theoptions
:b)
videoinput
toaudiooutput
in theenumerateReady
handler's body:c)
setVideoInput
tosetAudioOutput
in thechangeVideoInput
method:d) rename
player
to something else, likemyplayer
The thing is that we don't want to create a global
player
here. In my case I use videojs-record with JS bundler and have no globals like that.Results
Expected
Output device is changed to the newly selected one
Actual
Output device is not changed and an exception is raised due to the
player
beingundefined
Error output
Additional Information
Same issue was reported a while ago: #649
versions
videojs
VIDEOJS: Using video.js 8.10.0 with videojs-record 4.8.0 and recordrtc 5.6.2
browsers
Tested on FF and Vivaldi but I believe all browsers are affected
OSes
Tested on PopOs but I believe all systems are affected
The text was updated successfully, but these errors were encountered: