mirror of
https://github.com/streamwall/streamwall.git
synced 2026-01-31 09:22:49 -05:00
Apply rotation on initial load
This commit is contained in:
@@ -244,7 +244,10 @@ async function main() {
|
|||||||
const viewInit = ipcRenderer.invoke('view-init')
|
const viewInit = ipcRenderer.invoke('view-init')
|
||||||
const pageReady = new Promise((resolve) => process.once('loaded', resolve))
|
const pageReady = new Promise((resolve) => process.once('loaded', resolve))
|
||||||
|
|
||||||
const [{ content }] = await Promise.all([viewInit, pageReady])
|
const [{ content, options: initialOptions }] = await Promise.all([
|
||||||
|
viewInit,
|
||||||
|
pageReady,
|
||||||
|
])
|
||||||
|
|
||||||
let rotationController
|
let rotationController
|
||||||
if (content.kind === 'video' || content.kind === 'audio') {
|
if (content.kind === 'video' || content.kind === 'audio') {
|
||||||
@@ -263,11 +266,13 @@ async function main() {
|
|||||||
|
|
||||||
ipcRenderer.send('view-loaded')
|
ipcRenderer.send('view-loaded')
|
||||||
|
|
||||||
ipcRenderer.on('options', (ev, options) => {
|
function updateOptions(options) {
|
||||||
if (rotationController) {
|
if (rotationController) {
|
||||||
rotationController.setCustom(options.rotation)
|
rotationController.setCustom(options.rotation)
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
ipcRenderer.on('options', (ev, options) => updateOptions(options))
|
||||||
|
updateOptions(initialOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
main().catch((err) => {
|
main().catch((err) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user