Skip to content

Commit

Permalink
Fix: Browser Navigate and Transition mix parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
thedist committed Jun 28, 2023
1 parent 0de592f commit de996b2
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ interface TransitionMixCallback {
mix: MixOptionEntry
functionID: (typeof TRANSITIONS)[number]
duration: number
input?: string
}>
}

Expand Down Expand Up @@ -1321,8 +1322,24 @@ export function getActions(instance: VMixInstance): VMixActions {
max: 9999,
default: 1000,
},
{
type: 'textinput',
label: 'Input - Leave blank to transition Preview',
id: 'input',
default: '',
tooltip: 'Number, Name, or GUID',
},
],
callback: sendBasicCommand,
callback: async (action) => {
if (action.options.input !== '' && action.options.input !== undefined) {
const input = (await instance.parseOption(action.options.input))[instance.buttonShift.state]
let useInput: any = { actionId: 'transitionMix', options: { mix: action.options.mix, functionID: action.options.functionID, duration: action.options.duration, input } }
sendBasicCommand(useInput)
} else {
let usePreview: any = { actionId: 'transitionMix', options: { mix: action.options.mix, functionID: action.options.functionID, duration: action.options.duration } }
sendBasicCommand(usePreview)
}
},
},

transition: {
Expand Down Expand Up @@ -3228,10 +3245,11 @@ export function getActions(instance: VMixInstance): VMixActions {
default: '',
},
],
callback: (action) => {
callback: async (action) => {
const value = await instance.parseVariablesInString(action.options.value)
if (instance.tcp)
instance.tcp.sendCommand(
`FUNCTION BrowserNavigate Input=${action.options.input}&Value=${action.options.url || action.options.value}`
`FUNCTION BrowserNavigate Input=${action.options.input}&Value=${value}`
)
},
},
Expand Down

0 comments on commit de996b2

Please sign in to comment.