fix list of recordable things

This commit is contained in:
Seth Call 2017-10-18 21:11:26 -05:00
parent 0e428c9922
commit a447b0ecfc
1 changed files with 28 additions and 5 deletions

View File

@ -7,6 +7,16 @@ ScreenRecordActive = 2
WebCam2RecordActive = 3
DesktopRecordActive = 4
recording_sources = [WebCamRecordActive, WebCam2RecordActive, ScreenRecordActive, DesktopRecordActive]
recording_data = {
2: {key: 'video-window', text: 'Record session video window'},
1: {key: 'webcam-only', text: 'Record my webcam only'},
3: {key: 'webcam-only-2', text: 'Record my 2nd webcam only'},
4: {key: 'desktop-only', text: 'Record my computer desktop'}
}
mixins = []
# make sure this is actually us opening the window, not someone else (by checking for MixerStore)
@ -102,7 +112,7 @@ if accessOpener
this.setState(showNote: !this.state.showNote)
getInitialState: () ->
{isRecording: window.ParentIsRecording, showNote: true, recordedOnce: false, chatMixer: MixerStore.mixers?.chatMixer}
{isRecording: window.ParentIsRecording, showNote: true, recordedOnce: false, chatMixer: MixerStore.mixers?.chatMixer, openWindows: []}
render: () ->
@ -126,6 +136,15 @@ if accessOpener
chatHelp = `<a href="#" onClick={this.onChatHelp} className="chat-help">[?]</a>`
options = []
for source in recording_sources
if this.state.openWindows?
found = this.state.openWindows.indexOf(source) > -1
if found
data = recording_data[source]
options.push(`<option value={data.key}>{data.text}</option>`)
recordingJSX =
`<div className="recording-options">
<div className="video-settings">
@ -142,10 +161,7 @@ if accessOpener
</div>
<div className="field">
<select className="easydropdown" name="recording-selection" id="recording-selection">
<option value="video-window">Record session video window</option>
<option value="webcam-only">Record my webcam only</option>
<option value="webcam-only-2">Record my 2nd webcam only</option>
<option value="desktop-only">Record my computer desktop</option>
{options}
</select>
</div>
</div>
@ -235,8 +251,15 @@ if accessOpener
$includeChat = $root.find('#include-chat')
context.JK.checkbox($includeChat)
openWindows = window.opener.jamClient.getOpenVideoSources()
fixedwindows = []
if openWindows?
for key, value of openWindows
fixedwindows.push(value)
this.setState({openWindows: fixedwindows})
@resizeWindow()
# this is necessary due to whatever the client's rendering behavior is.