@@ -13,6 +13,7 @@ import { UIStudio } from '@sofie-automation/meteor-lib/dist/api/studios'
1313import { ITranslatableMessage , translateMessage } from '@sofie-automation/corelib/dist/TranslatableMessage'
1414import { IFloatingInspectorPosition , useInspectorPosition } from './IFloatingInspectorPosition'
1515import { ReadonlyDeep } from 'type-fest'
16+ import { getIgnorePieceContentStatus } from '../../lib/localStorage'
1617
1718interface IProps {
1819 status : PieceStatusCode | undefined
@@ -109,19 +110,25 @@ export const VTFloatingInspector: React.FC<IProps> = ({
109110 const { t } = useTranslation ( )
110111 const inspectorRef = useRef < HTMLDivElement > ( null )
111112
113+ // a fake preview (only hover at On Air of playing VT) can be shown
114+ // by adding ?ignore_piece_content_status=1 to the url
115+ // this is only used for development purposes
116+ const debugMode = getIgnorePieceContentStatus ( )
117+ const playPreviewUrl = debugMode ? 'http://some-ip-here:3000/preview.mp4' : previewUrl || ''
118+
112119 const itemDuration = content ?. sourceDuration || renderedDuration || 0
113120 const seek = content ?. seek ?? 0
114121 const loop = content ?. loop ?? false
115122
116123 const offsetTimePosition = timePosition + seek
117124
118- const showVideoPlayerInspector = ! hideHoverscrubPreview && previewUrl
125+ const showVideoPlayerInspector = ! hideHoverscrubPreview && ( previewUrl || debugMode )
119126 const showMiniInspectorClipData = shouldShowFloatingInspectorContent ( status ?? PieceStatusCode . UNKNOWN , content )
120127 const showMiniInspectorNotice = noticeLevel !== null
121128 const showMiniInspectorData = showMiniInspectorNotice || showMiniInspectorClipData
122129 const showAnyFloatingInspector = Boolean ( showVideoPlayerInspector ) || showMiniInspectorData
123130
124- const shown = showMiniInspector && itemElement !== undefined && showAnyFloatingInspector
131+ const shown = showMiniInspector && ( itemElement !== undefined || debugMode ) && showAnyFloatingInspector
125132
126133 const { style : floatingInspectorStyle , isFlipped } = useInspectorPosition ( position , inspectorRef , shown )
127134
@@ -157,7 +164,7 @@ export const VTFloatingInspector: React.FC<IProps> = ({
157164 ref = { inspectorRef }
158165 loop = { loop }
159166 seek = { seek }
160- previewUrl = { previewUrl }
167+ previewUrl = { playPreviewUrl }
161168 timePosition = { offsetTimePosition }
162169 studioSettings = { studio ?. settings }
163170 floatingInspectorStyle = { floatingInspectorStyle }
0 commit comments