|
|
@ -3,15 +3,16 @@ import Broadcast from '@/components/svgIcon'; |
|
|
|
import Tooltip from '@/components/tooltip'; |
|
|
|
import Tooltip from '@/components/tooltip'; |
|
|
|
import { contextType, FlowContext } from '@/core/context'; |
|
|
|
import { contextType, FlowContext } from '@/core/context'; |
|
|
|
import { useVideo } from '@/core/useVideo'; |
|
|
|
import { useVideo } from '@/core/useVideo'; |
|
|
|
import { secondsToMinutesAndSecondes, capture } from '@/utils'; |
|
|
|
import { secondsToMinutesAndSecondes, capture, filterDefaults } from '@/utils'; |
|
|
|
import { useControls } from './variable'; |
|
|
|
import { useControls } from './variable'; |
|
|
|
import useWindowClient from '@/utils/useWindowClient'; |
|
|
|
import useWindowClient from '@/utils/useWindowClient'; |
|
|
|
import screenfull, { Screenfull } from 'screenfull'; |
|
|
|
import screenfull, { Screenfull } from 'screenfull'; |
|
|
|
import { multipleList, defaultVolume } from '@/core/config'; |
|
|
|
import { multipleList, defaultVolume, defaultLanguage } from '@/core/config'; |
|
|
|
import SetComponent from './set'; |
|
|
|
import SetComponent from './set'; |
|
|
|
import MultipleComponent from './multiple'; |
|
|
|
import MultipleComponent from './multiple'; |
|
|
|
import VolumeComponent from './volume'; |
|
|
|
import VolumeComponent from './volume'; |
|
|
|
import MonitorComponent from './monitor'; |
|
|
|
import MonitorComponent from './monitor'; |
|
|
|
|
|
|
|
import { il8n } from '@/language'; |
|
|
|
import './index.scss'; |
|
|
|
import './index.scss'; |
|
|
|
|
|
|
|
|
|
|
|
const Index: FC<{ setIsscreenshot: Function; setScreenshotLoading: Function }> = memo( |
|
|
|
const Index: FC<{ setIsscreenshot: Function; setScreenshotLoading: Function }> = memo( |
|
|
@ -162,7 +163,7 @@ const Index: FC<{ setIsscreenshot: Function; setScreenshotLoading: Function }> = |
|
|
|
}; |
|
|
|
}; |
|
|
|
const multipleText = useMemo(() => { |
|
|
|
const multipleText = useMemo(() => { |
|
|
|
if (controlsState.multiple === 1.0) { |
|
|
|
if (controlsState.multiple === 1.0) { |
|
|
|
return '倍数'; |
|
|
|
return il8n(propsAttributes!.language || defaultLanguage, 'multiple'); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return multipleList.filter((item) => item.id === controlsState.multiple)[0].name; |
|
|
|
return multipleList.filter((item) => item.id === controlsState.multiple)[0].name; |
|
|
|
} |
|
|
|
} |
|
|
@ -217,11 +218,17 @@ const Index: FC<{ setIsscreenshot: Function; setScreenshotLoading: Function }> = |
|
|
|
dispatch({ type: 'isMuted', data: controlsState.isMuted ? false : true }); |
|
|
|
dispatch({ type: 'isMuted', data: controlsState.isMuted ? false : true }); |
|
|
|
reviceProps.videoRef!.muted = controlsState.isMuted ? false : true; |
|
|
|
reviceProps.videoRef!.muted = controlsState.isMuted ? false : true; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* @description 全屏之后,对控件的间距设置一下 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
const space = useMemo(() => { |
|
|
|
|
|
|
|
return controlsState.isScreentFull || controlsState.isWebPageFullScreen ? '13px' : '8px'; |
|
|
|
|
|
|
|
}, [controlsState.isWebPageFullScreen, controlsState.isScreentFull]); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div |
|
|
|
<div |
|
|
|
className="JoL-controls-container" |
|
|
|
className="JoL-controls-container" |
|
|
|
// style={{ opacity: reviceProps.videoFlow!.isControl ? '1' : '0' }}
|
|
|
|
style={{ opacity: reviceProps.videoFlow!.isControl ? '1' : '0' }} |
|
|
|
> |
|
|
|
> |
|
|
|
<MonitorComponent |
|
|
|
<MonitorComponent |
|
|
|
isPlay={isPlay} |
|
|
|
isPlay={isPlay} |
|
|
@ -230,15 +237,17 @@ const Index: FC<{ setIsscreenshot: Function; setScreenshotLoading: Function }> = |
|
|
|
totalTime={secondsToMinutesAndSecondes(duration)} |
|
|
|
totalTime={secondsToMinutesAndSecondes(duration)} |
|
|
|
/> |
|
|
|
/> |
|
|
|
<div className="JoL-multifunction"> |
|
|
|
<div className="JoL-multifunction"> |
|
|
|
{propsAttributes!.isShowMultiple && ( |
|
|
|
{filterDefaults(propsAttributes!.isShowMultiple) && ( |
|
|
|
<MultipleComponent |
|
|
|
<MultipleComponent |
|
|
|
multipleText={multipleText} |
|
|
|
multipleText={multipleText} |
|
|
|
multiple={controlsState.multiple} |
|
|
|
multiple={controlsState.multiple} |
|
|
|
selectPlayRate={selectPlayRate} |
|
|
|
selectPlayRate={selectPlayRate} |
|
|
|
/> |
|
|
|
/> |
|
|
|
)} |
|
|
|
)} |
|
|
|
|
|
|
|
|
|
|
|
<VolumeComponent |
|
|
|
<VolumeComponent |
|
|
|
|
|
|
|
style={{ |
|
|
|
|
|
|
|
padding: `0 ${space}`, |
|
|
|
|
|
|
|
}} |
|
|
|
ref={volumeSliderMirror} |
|
|
|
ref={volumeSliderMirror} |
|
|
|
volume={controlsState.volume} |
|
|
|
volume={controlsState.volume} |
|
|
|
changeCurrentVolume={changeCurrentVolume} |
|
|
|
changeCurrentVolume={changeCurrentVolume} |
|
|
@ -247,10 +256,18 @@ const Index: FC<{ setIsscreenshot: Function; setScreenshotLoading: Function }> = |
|
|
|
isMuted={controlsState.isMuted} |
|
|
|
isMuted={controlsState.isMuted} |
|
|
|
toggleVolume={toggleVolume} |
|
|
|
toggleVolume={toggleVolume} |
|
|
|
/> |
|
|
|
/> |
|
|
|
<SetComponent switchChange={switchChange} /> |
|
|
|
{filterDefaults(propsAttributes!.isShowSet) && ( |
|
|
|
|
|
|
|
<SetComponent |
|
|
|
|
|
|
|
switchChange={switchChange} |
|
|
|
|
|
|
|
style={{ |
|
|
|
|
|
|
|
padding: `0 ${space}`, |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
{filterDefaults(propsAttributes!.isShowScreenshot) && ( |
|
|
|
<Tooltip |
|
|
|
<Tooltip |
|
|
|
styleCss={{ padding: '0 5px' }} |
|
|
|
styleCss={{ padding: `0 ${space}` }} |
|
|
|
title="截图" |
|
|
|
title={il8n(propsAttributes!.language || defaultLanguage, 'screenshots')} |
|
|
|
icon={ |
|
|
|
icon={ |
|
|
|
<Broadcast |
|
|
|
<Broadcast |
|
|
|
iconClass="screenshot" |
|
|
|
iconClass="screenshot" |
|
|
@ -260,9 +277,14 @@ const Index: FC<{ setIsscreenshot: Function; setScreenshotLoading: Function }> = |
|
|
|
/> |
|
|
|
/> |
|
|
|
} |
|
|
|
} |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
{filterDefaults(propsAttributes!.isShowPicture) && ( |
|
|
|
<Tooltip |
|
|
|
<Tooltip |
|
|
|
styleCss={{ padding: '0 5px' }} |
|
|
|
styleCss={{ padding: `0 ${space}` }} |
|
|
|
title={isPictureinpicture ? '关闭画中画' : '开启画中画'} |
|
|
|
title={il8n( |
|
|
|
|
|
|
|
propsAttributes!.language || defaultLanguage, |
|
|
|
|
|
|
|
isPictureinpicture ? 'closePicture' : 'openPicture', |
|
|
|
|
|
|
|
)} |
|
|
|
icon={ |
|
|
|
icon={ |
|
|
|
<Broadcast |
|
|
|
<Broadcast |
|
|
|
iconClass="fullScreen" |
|
|
|
iconClass="fullScreen" |
|
|
@ -273,9 +295,11 @@ const Index: FC<{ setIsscreenshot: Function; setScreenshotLoading: Function }> = |
|
|
|
/> |
|
|
|
/> |
|
|
|
} |
|
|
|
} |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
{filterDefaults(propsAttributes!.isShowWebFullScreen) && ( |
|
|
|
<Tooltip |
|
|
|
<Tooltip |
|
|
|
styleCss={{ padding: '0 5px' }} |
|
|
|
styleCss={{ padding: `0 ${space}` }} |
|
|
|
title="网页全屏" |
|
|
|
title={il8n(propsAttributes!.language || defaultLanguage, 'Fullscreen')} |
|
|
|
icon={ |
|
|
|
icon={ |
|
|
|
<Broadcast |
|
|
|
<Broadcast |
|
|
|
iconClass="fullScreen" |
|
|
|
iconClass="fullScreen" |
|
|
@ -286,9 +310,13 @@ const Index: FC<{ setIsscreenshot: Function; setScreenshotLoading: Function }> = |
|
|
|
/> |
|
|
|
/> |
|
|
|
} |
|
|
|
} |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
)} |
|
|
|
<Tooltip |
|
|
|
<Tooltip |
|
|
|
styleCss={{ padding: '0 5px' }} |
|
|
|
styleCss={{ padding: `0 ${space}` }} |
|
|
|
title={controlsState.isScreentFull ? '退出全屏' : '全屏'} |
|
|
|
title={il8n( |
|
|
|
|
|
|
|
propsAttributes!.language || defaultLanguage, |
|
|
|
|
|
|
|
controlsState.isScreentFull ? 'closefullScreen' : 'fullScreen', |
|
|
|
|
|
|
|
)} |
|
|
|
icon={ |
|
|
|
icon={ |
|
|
|
<Broadcast |
|
|
|
<Broadcast |
|
|
|
iconClass="fullScreen" |
|
|
|
iconClass="fullScreen" |
|
|
|