Skip to content

Commit

Permalink
fix(可视化): 视频组件
Browse files Browse the repository at this point in the history
视频组件物模型调整

re #194
  • Loading branch information
Lind-pro committed Oct 14, 2020
1 parent 79d4e43 commit e7d319b
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/pages/device/visualization/charts/Video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,24 @@ const Video: React.FC<Props> = (props) => {
if (props.edit) {
props.edit(() => props.config);
}

console.log(config, 'configs');
if (config.urlType === 'input') {
setSrcUrl(config.url)
} else if (config.urlType === 'switch') {
service.propertySource(deviceId, config.property).subscribe((data) => {
const url = JSON.parse(data.value)[config.target];
setSrcUrl(url);
if (data?.value) {
const url = data.value[config.target];
setSrcUrl(url);
} else {
message.error('不存在视频源数据!');
}
})
}

}, []);

const renderVideo = () => {
// return <VideoPlayer {...videoJsOptions} width={width} height={height} />
return <FlashVideo url={srcUrl || ''} width={width} height={height} />
}
return (
<div >
{srcUrl && renderVideo()}
{srcUrl && <FlashVideo url={srcUrl || ''} width={width} height={height} />}
</div>
)
}
Expand Down

0 comments on commit e7d319b

Please sign in to comment.