|
|
@ -1,9 +1,9 @@ |
|
|
|
import React, { memo, useContext, useRef, useEffect, useMemo, useCallback } from 'react'; |
|
|
|
import React, { memo, useContext, useRef, useEffect, useMemo, FC } from 'react'; |
|
|
|
import Broadcast from '@/components/svgIcon'; |
|
|
|
import Broadcast from '@/components/svgIcon'; |
|
|
|
import Tooltip from '@/components/tooltip'; |
|
|
|
import Tooltip from '@/components/tooltip'; |
|
|
|
import { FlowContext } from '@/core/context'; |
|
|
|
import { contextType, FlowContext } from '@/core/context'; |
|
|
|
import { useVideo } from '@/core/useVideo'; |
|
|
|
import { useVideo } from '@/core/useVideo'; |
|
|
|
import { secondsToMinutesAndSecondes, createALabel } from '@/utils'; |
|
|
|
import { secondsToMinutesAndSecondes, capture } 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'; |
|
|
@ -14,286 +14,295 @@ import VolumeComponent from './volume'; |
|
|
|
import MonitorComponent from './monitor'; |
|
|
|
import MonitorComponent from './monitor'; |
|
|
|
import './index.scss'; |
|
|
|
import './index.scss'; |
|
|
|
|
|
|
|
|
|
|
|
const Index = memo(function Index(props) { |
|
|
|
const Index: FC<{ setIsscreenshot: Function; setScreenshotLoading: Function }> = memo( |
|
|
|
/** |
|
|
|
function Index({ setIsscreenshot, setScreenshotLoading }) { |
|
|
|
* @description 音量滑动元素 |
|
|
|
/** |
|
|
|
*/ |
|
|
|
* @description 音量滑动元素 |
|
|
|
const volumeSliderMirror = useRef<HTMLDivElement>(null!); |
|
|
|
*/ |
|
|
|
|
|
|
|
const volumeSliderMirror = useRef<HTMLDivElement>(null!); |
|
|
|
|
|
|
|
|
|
|
|
const clientYdistance = useRef<number>(0); |
|
|
|
const clientYdistance = useRef<number>(0); |
|
|
|
|
|
|
|
|
|
|
|
const volumeInterval = useRef<NodeJS.Timeout | null>(null); |
|
|
|
const volumeInterval = useRef<NodeJS.Timeout | null>(null); |
|
|
|
|
|
|
|
|
|
|
|
const reviceProps = useContext(FlowContext); |
|
|
|
const reviceProps = useContext(FlowContext); |
|
|
|
|
|
|
|
|
|
|
|
const revicePropsData = useRef<any>(); |
|
|
|
const { propsAttributes } = reviceProps!; |
|
|
|
|
|
|
|
|
|
|
|
const { isPlay, handleChangePlayState, currentTime, duration, isPictureinpicture, volume } = |
|
|
|
const revicePropsData = useRef<contextType>(); |
|
|
|
useVideo( |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
videoElement: reviceProps.videoRef, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
[reviceProps.videoRef], |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { controlsState, dispatch } = useControls(); |
|
|
|
const { isPlay, handleChangePlayState, currentTime, duration, isPictureinpicture, volume } = |
|
|
|
|
|
|
|
useVideo( |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
videoElement: reviceProps.videoRef, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
[reviceProps.videoRef], |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
const { clientY } = useWindowClient(); |
|
|
|
const { controlsState, dispatch } = useControls(); |
|
|
|
|
|
|
|
|
|
|
|
clientYdistance.current = clientY; |
|
|
|
const { clientY } = useWindowClient(); |
|
|
|
|
|
|
|
|
|
|
|
revicePropsData.current = reviceProps; |
|
|
|
clientYdistance.current = clientY; |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
revicePropsData.current = reviceProps; |
|
|
|
/** |
|
|
|
|
|
|
|
* @description 如果调用了setVolume函数,这边的数据就要保持和video的数据一致 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
dispatch({ type: 'volume', data: Math.floor(volume * 100) }); |
|
|
|
|
|
|
|
}, [volume]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
useEffect(() => { |
|
|
|
// 为了防止音量滑动元素计时器不暂停
|
|
|
|
/** |
|
|
|
window.addEventListener('mouseup', whenMouseUpDo); |
|
|
|
* @description 如果调用了setVolume函数,这边的数据就要保持和video的数据一致 |
|
|
|
return () => { |
|
|
|
*/ |
|
|
|
window.removeEventListener('mouseup', whenMouseUpDo); |
|
|
|
dispatch({ type: 'volume', data: Math.floor(volume * 100) }); |
|
|
|
}; |
|
|
|
}, [volume]); |
|
|
|
}, []); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
useEffect(() => { |
|
|
|
* @description 更新当前音量控制条 |
|
|
|
// 为了防止音量滑动元素计时器不暂停
|
|
|
|
*/ |
|
|
|
window.addEventListener('mouseup', whenMouseUpDo); |
|
|
|
const updateCurrentVolume = (volumePercent: number) => { |
|
|
|
return () => { |
|
|
|
const videoRef = reviceProps.videoRef!; |
|
|
|
window.removeEventListener('mouseup', whenMouseUpDo); |
|
|
|
if (volumePercent >= 0 && volumePercent <= 1) { |
|
|
|
}; |
|
|
|
videoRef.volume = volumePercent; |
|
|
|
}, []); |
|
|
|
videoRef.muted = false; |
|
|
|
|
|
|
|
dispatch({ type: 'volume', data: volumePercent * 100 }); |
|
|
|
|
|
|
|
dispatch({ type: 'isMuted', data: Math.floor(volumePercent * 100) === 0 ? true : false }); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (volumePercent < 0) { |
|
|
|
|
|
|
|
videoRef.volume = 0; |
|
|
|
|
|
|
|
videoRef.muted = true; |
|
|
|
|
|
|
|
dispatch({ type: 'volume', data: 0 }); |
|
|
|
|
|
|
|
dispatch({ type: 'isMuted', data: true }); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (volumePercent > 1) { |
|
|
|
|
|
|
|
videoRef.volume = 1; |
|
|
|
|
|
|
|
dispatch({ type: 'volume', data: 100 }); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param e event对象 |
|
|
|
|
|
|
|
* @description 音量滑动元素点击 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
const changeCurrentVolume: React.MouseEventHandler<HTMLDivElement> = (e) => { |
|
|
|
|
|
|
|
e.stopPropagation(); |
|
|
|
|
|
|
|
const volumeSliderMirrorElement = ( |
|
|
|
|
|
|
|
volumeSliderMirror.current as HTMLDivElement & { element: HTMLDivElement } |
|
|
|
|
|
|
|
).element; |
|
|
|
|
|
|
|
// 获取音量区域高度
|
|
|
|
|
|
|
|
const volumeAreaHeight = volumeSliderMirrorElement.offsetHeight; |
|
|
|
|
|
|
|
// 获取当前位置在整个音量区域高度的占比
|
|
|
|
|
|
|
|
const volumePercent = |
|
|
|
|
|
|
|
1 - (e.clientY - volumeSliderMirrorElement.getBoundingClientRect().top) / volumeAreaHeight; |
|
|
|
|
|
|
|
// 修改当前音量大小
|
|
|
|
|
|
|
|
updateCurrentVolume(volumePercent); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const slideCurrentVolume: React.MouseEventHandler<HTMLDivElement> = (e) => { |
|
|
|
/** |
|
|
|
e.stopPropagation(); |
|
|
|
* @description 更新当前音量控制条 |
|
|
|
const volumeSliderMirrorElement = ( |
|
|
|
*/ |
|
|
|
volumeSliderMirror.current as HTMLDivElement & { element: HTMLDivElement } |
|
|
|
const updateCurrentVolume = (volumePercent: number) => { |
|
|
|
).element; |
|
|
|
const videoRef = reviceProps.videoRef!; |
|
|
|
// 获取音量区域高度
|
|
|
|
if (volumePercent >= 0 && volumePercent <= 1) { |
|
|
|
const volumeAreaHeight = volumeSliderMirrorElement.offsetHeight; |
|
|
|
videoRef.volume = volumePercent; |
|
|
|
// 防止点击的时候,再次出发计时器,重而造成点击卡顿
|
|
|
|
videoRef.muted = false; |
|
|
|
volumeInterval.current && clearInterval(volumeInterval.current); |
|
|
|
dispatch({ type: 'volume', data: volumePercent * 100 }); |
|
|
|
volumeInterval.current = setInterval(() => { |
|
|
|
dispatch({ type: 'isMuted', data: Math.floor(volumePercent * 100) === 0 ? true : false }); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (volumePercent < 0) { |
|
|
|
|
|
|
|
videoRef.volume = 0; |
|
|
|
|
|
|
|
videoRef.muted = true; |
|
|
|
|
|
|
|
dispatch({ type: 'volume', data: 0 }); |
|
|
|
|
|
|
|
dispatch({ type: 'isMuted', data: true }); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (volumePercent > 1) { |
|
|
|
|
|
|
|
videoRef.volume = 1; |
|
|
|
|
|
|
|
dispatch({ type: 'volume', data: 100 }); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param e event对象 |
|
|
|
|
|
|
|
* @description 音量滑动元素点击 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
const changeCurrentVolume: React.MouseEventHandler<HTMLDivElement> = (e) => { |
|
|
|
|
|
|
|
e.stopPropagation(); |
|
|
|
|
|
|
|
const volumeSliderMirrorElement = ( |
|
|
|
|
|
|
|
volumeSliderMirror.current as HTMLDivElement & { element: HTMLDivElement } |
|
|
|
|
|
|
|
).element; |
|
|
|
|
|
|
|
// 获取音量区域高度
|
|
|
|
|
|
|
|
const volumeAreaHeight = volumeSliderMirrorElement.offsetHeight; |
|
|
|
// 获取当前位置在整个音量区域高度的占比
|
|
|
|
// 获取当前位置在整个音量区域高度的占比
|
|
|
|
const volumePercent = |
|
|
|
const volumePercent = |
|
|
|
1 - |
|
|
|
1 - (e.clientY - volumeSliderMirrorElement.getBoundingClientRect().top) / volumeAreaHeight; |
|
|
|
(clientYdistance.current - volumeSliderMirrorElement.getBoundingClientRect().top) / |
|
|
|
|
|
|
|
volumeAreaHeight; |
|
|
|
|
|
|
|
// 修改当前音量大小
|
|
|
|
// 修改当前音量大小
|
|
|
|
updateCurrentVolume(volumePercent); |
|
|
|
updateCurrentVolume(volumePercent); |
|
|
|
dispatch({ type: 'isSlideVolume', data: true }); |
|
|
|
}; |
|
|
|
}, 1); |
|
|
|
|
|
|
|
}; |
|
|
|
const slideCurrentVolume: React.MouseEventHandler<HTMLDivElement> = (e) => { |
|
|
|
// 当鼠标抬起时
|
|
|
|
e.stopPropagation(); |
|
|
|
const whenMouseUpDo = () => { |
|
|
|
const volumeSliderMirrorElement = ( |
|
|
|
volumeInterval.current && clearInterval(volumeInterval.current); |
|
|
|
volumeSliderMirror.current as HTMLDivElement & { element: HTMLDivElement } |
|
|
|
dispatch({ type: 'isSlideVolume', data: false }); |
|
|
|
).element; |
|
|
|
}; |
|
|
|
// 获取音量区域高度
|
|
|
|
const clearVolumeInterval: React.MouseEventHandler<HTMLDivElement> = (e) => { |
|
|
|
const volumeAreaHeight = volumeSliderMirrorElement.offsetHeight; |
|
|
|
e.stopPropagation(); |
|
|
|
// 防止点击的时候,再次出发计时器,重而造成点击卡顿
|
|
|
|
whenMouseUpDo(); |
|
|
|
volumeInterval.current && clearInterval(volumeInterval.current); |
|
|
|
}; |
|
|
|
volumeInterval.current = setInterval(() => { |
|
|
|
/** |
|
|
|
// 获取当前位置在整个音量区域高度的占比
|
|
|
|
* @description 开启全屏 |
|
|
|
const volumePercent = |
|
|
|
*/ |
|
|
|
1 - |
|
|
|
const requestFullScreen = () => { |
|
|
|
(clientYdistance.current - volumeSliderMirrorElement.getBoundingClientRect().top) / |
|
|
|
if (screenfull.isEnabled) { |
|
|
|
volumeAreaHeight; |
|
|
|
screenfull.toggle(reviceProps.videoContainerRef!); |
|
|
|
// 修改当前音量大小
|
|
|
|
screenfull.on('change', () => |
|
|
|
updateCurrentVolume(volumePercent); |
|
|
|
dispatch({ type: 'isScreentFull', data: (screenfull as Screenfull).isFullscreen }), |
|
|
|
dispatch({ type: 'isSlideVolume', data: true }); |
|
|
|
); |
|
|
|
}, 1); |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
// 当鼠标抬起时
|
|
|
|
/** |
|
|
|
const whenMouseUpDo = () => { |
|
|
|
* @description 开启画中画 |
|
|
|
volumeInterval.current && clearInterval(volumeInterval.current); |
|
|
|
*/ |
|
|
|
dispatch({ type: 'isSlideVolume', data: false }); |
|
|
|
const pictureInPicture = () => { |
|
|
|
}; |
|
|
|
if (isPictureinpicture) { |
|
|
|
const clearVolumeInterval: React.MouseEventHandler<HTMLDivElement> = (e) => { |
|
|
|
(document as any).exitPictureInPicture(); |
|
|
|
e.stopPropagation(); |
|
|
|
} else { |
|
|
|
whenMouseUpDo(); |
|
|
|
(reviceProps.videoRef! as any).requestPictureInPicture(); |
|
|
|
}; |
|
|
|
} |
|
|
|
/** |
|
|
|
}; |
|
|
|
* @description 开启全屏 |
|
|
|
/** |
|
|
|
*/ |
|
|
|
* @description 设置视频倍数 |
|
|
|
const requestFullScreen = () => { |
|
|
|
*/ |
|
|
|
if (screenfull.isEnabled) { |
|
|
|
const selectPlayRate = (playbackRate: number) => { |
|
|
|
screenfull.toggle(reviceProps.videoContainerRef!); |
|
|
|
reviceProps.videoRef!.playbackRate = playbackRate; |
|
|
|
screenfull.on('change', () => |
|
|
|
dispatch({ type: 'multiple', data: playbackRate }); |
|
|
|
dispatch({ type: 'isScreentFull', data: (screenfull as Screenfull).isFullscreen }), |
|
|
|
}; |
|
|
|
); |
|
|
|
const multipleText = useMemo(() => { |
|
|
|
|
|
|
|
if (controlsState.multiple === 1.0) { |
|
|
|
|
|
|
|
return '倍数'; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return multipleList.filter((item) => item.id === controlsState.multiple)[0].name; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, [controlsState.multiple]); |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* @description 在线截图 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
const screenshot = () => { |
|
|
|
|
|
|
|
const canvas = document.createElement('canvas') as HTMLCanvasElement; |
|
|
|
|
|
|
|
canvas.width = reviceProps.videoRef!.offsetWidth; |
|
|
|
|
|
|
|
canvas.height = reviceProps.videoRef!.offsetHeight; |
|
|
|
|
|
|
|
const context = canvas.getContext('2d')!; |
|
|
|
|
|
|
|
context.drawImage(reviceProps.videoRef!, 0, 0, canvas.width, canvas.height); |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
createALabel(canvas.toDataURL('image/png')); |
|
|
|
|
|
|
|
} catch (error) {} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* @description 设置 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
const switchChange = (e: string, flag: string) => { |
|
|
|
|
|
|
|
const { videoRef, lightOffMaskRef } = revicePropsData.current; |
|
|
|
|
|
|
|
if (flag === 'lights') { |
|
|
|
|
|
|
|
if (lightOffMaskRef) { |
|
|
|
|
|
|
|
lightOffMaskRef.style.display = e === 'yes' ? 'block' : 'none'; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
}; |
|
|
|
const loop = videoRef.loop; |
|
|
|
/** |
|
|
|
videoRef.loop = loop ? false : true; |
|
|
|
* @description 开启画中画 |
|
|
|
} |
|
|
|
*/ |
|
|
|
}; |
|
|
|
const pictureInPicture = () => { |
|
|
|
/** |
|
|
|
if (isPictureinpicture) { |
|
|
|
* @description 网页全屏 |
|
|
|
(document as any).exitPictureInPicture(); |
|
|
|
*/ |
|
|
|
} else { |
|
|
|
const clientFullScreen = () => { |
|
|
|
(reviceProps.videoRef! as any).requestPictureInPicture(); |
|
|
|
const videoContainerRef = reviceProps.videoContainerRef!; |
|
|
|
} |
|
|
|
if (videoContainerRef.classList.contains('clientFullScreen')) { |
|
|
|
}; |
|
|
|
videoContainerRef.classList.remove('clientFullScreen'); |
|
|
|
/** |
|
|
|
dispatch({ type: 'isWebPageFullScreen', data: false }); |
|
|
|
* @description 设置视频倍数 |
|
|
|
} else { |
|
|
|
*/ |
|
|
|
videoContainerRef.classList.add('clientFullScreen'); |
|
|
|
const selectPlayRate = (playbackRate: number) => { |
|
|
|
dispatch({ type: 'isWebPageFullScreen', data: true }); |
|
|
|
reviceProps.videoRef!.playbackRate = playbackRate; |
|
|
|
} |
|
|
|
dispatch({ type: 'multiple', data: playbackRate }); |
|
|
|
}; |
|
|
|
}; |
|
|
|
/** |
|
|
|
const multipleText = useMemo(() => { |
|
|
|
* @description 静音键和非静音键的切换 |
|
|
|
if (controlsState.multiple === 1.0) { |
|
|
|
*/ |
|
|
|
return '倍数'; |
|
|
|
const toggleVolume = () => { |
|
|
|
} else { |
|
|
|
reviceProps.videoRef!.volume = controlsState.isMuted ? defaultVolume / 100 : 0; |
|
|
|
return multipleList.filter((item) => item.id === controlsState.multiple)[0].name; |
|
|
|
dispatch({ type: 'isMuted', data: controlsState.isMuted ? false : true }); |
|
|
|
} |
|
|
|
reviceProps.videoRef!.muted = controlsState.isMuted ? false : true; |
|
|
|
}, [controlsState.multiple]); |
|
|
|
}; |
|
|
|
/** |
|
|
|
|
|
|
|
* @description 在线截图 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
const screenshot = async () => { |
|
|
|
|
|
|
|
const output = document.querySelector('#JoL-screenshotCanvas')!; |
|
|
|
|
|
|
|
const canvas = capture(reviceProps.videoRef!, 0.45); |
|
|
|
|
|
|
|
setIsscreenshot(true); |
|
|
|
|
|
|
|
if (output) { |
|
|
|
|
|
|
|
setScreenshotLoading(false); |
|
|
|
|
|
|
|
output.innerHTML = ''; |
|
|
|
|
|
|
|
output.appendChild(canvas); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
setScreenshotLoading(true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* @description 设置 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
const switchChange = (e: string, flag: string) => { |
|
|
|
|
|
|
|
const { videoRef, lightOffMaskRef } = revicePropsData.current!; |
|
|
|
|
|
|
|
if (flag === 'lights') { |
|
|
|
|
|
|
|
if (lightOffMaskRef) { |
|
|
|
|
|
|
|
lightOffMaskRef.style.display = e === 'yes' ? 'block' : 'none'; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
const loop = videoRef!.loop; |
|
|
|
|
|
|
|
videoRef!.loop = loop ? false : true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* @description 网页全屏 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
const clientFullScreen = () => { |
|
|
|
|
|
|
|
const videoContainerRef = reviceProps.videoContainerRef!; |
|
|
|
|
|
|
|
if (videoContainerRef.classList.contains('clientFullScreen')) { |
|
|
|
|
|
|
|
videoContainerRef.classList.remove('clientFullScreen'); |
|
|
|
|
|
|
|
dispatch({ type: 'isWebPageFullScreen', data: false }); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
videoContainerRef.classList.add('clientFullScreen'); |
|
|
|
|
|
|
|
dispatch({ type: 'isWebPageFullScreen', data: true }); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* @description 静音键和非静音键的切换 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
const toggleVolume = () => { |
|
|
|
|
|
|
|
reviceProps.videoRef!.volume = controlsState.isMuted ? defaultVolume / 100 : 0; |
|
|
|
|
|
|
|
dispatch({ type: 'isMuted', data: controlsState.isMuted ? false : true }); |
|
|
|
|
|
|
|
reviceProps.videoRef!.muted = controlsState.isMuted ? false : true; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
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} |
|
|
|
handleChangePlayState={handleChangePlayState} |
|
|
|
handleChangePlayState={handleChangePlayState} |
|
|
|
currentTime={secondsToMinutesAndSecondes(currentTime)} |
|
|
|
currentTime={secondsToMinutesAndSecondes(currentTime)} |
|
|
|
totalTime={secondsToMinutesAndSecondes(duration)} |
|
|
|
totalTime={secondsToMinutesAndSecondes(duration)} |
|
|
|
/> |
|
|
|
|
|
|
|
<div className="JoL-multifunction"> |
|
|
|
|
|
|
|
<MultipleComponent |
|
|
|
|
|
|
|
multipleText={multipleText} |
|
|
|
|
|
|
|
multiple={controlsState.multiple} |
|
|
|
|
|
|
|
selectPlayRate={selectPlayRate} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<VolumeComponent |
|
|
|
|
|
|
|
ref={volumeSliderMirror} |
|
|
|
|
|
|
|
volume={controlsState.volume} |
|
|
|
|
|
|
|
changeCurrentVolume={changeCurrentVolume} |
|
|
|
|
|
|
|
slideCurrentVolume={slideCurrentVolume} |
|
|
|
|
|
|
|
clearVolumeInterval={clearVolumeInterval} |
|
|
|
|
|
|
|
isMuted={controlsState.isMuted} |
|
|
|
|
|
|
|
toggleVolume={toggleVolume} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<SetComponent switchChange={switchChange} /> |
|
|
|
|
|
|
|
<Tooltip |
|
|
|
|
|
|
|
styleCss={{ padding: '0 5px' }} |
|
|
|
|
|
|
|
title="截图" |
|
|
|
|
|
|
|
icon={ |
|
|
|
|
|
|
|
<Broadcast |
|
|
|
|
|
|
|
iconClass="screenshot" |
|
|
|
|
|
|
|
className="hover-icon-animate" |
|
|
|
|
|
|
|
fill="#fff" |
|
|
|
|
|
|
|
onClick={screenshot} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/> |
|
|
|
/> |
|
|
|
<Tooltip |
|
|
|
<div className="JoL-multifunction"> |
|
|
|
styleCss={{ padding: '0 5px' }} |
|
|
|
{propsAttributes!.isShowMultiple && ( |
|
|
|
title={isPictureinpicture ? '关闭画中画' : '开启画中画'} |
|
|
|
<MultipleComponent |
|
|
|
icon={ |
|
|
|
multipleText={multipleText} |
|
|
|
<Broadcast |
|
|
|
multiple={controlsState.multiple} |
|
|
|
iconClass="fullScreen" |
|
|
|
selectPlayRate={selectPlayRate} |
|
|
|
fill="#fff" |
|
|
|
|
|
|
|
className="hover-icon-animate" |
|
|
|
|
|
|
|
fontSize={'20px'} |
|
|
|
|
|
|
|
onClick={pictureInPicture} |
|
|
|
|
|
|
|
/> |
|
|
|
/> |
|
|
|
} |
|
|
|
)} |
|
|
|
/> |
|
|
|
|
|
|
|
<Tooltip |
|
|
|
<VolumeComponent |
|
|
|
styleCss={{ padding: '0 5px' }} |
|
|
|
ref={volumeSliderMirror} |
|
|
|
title="网页全屏" |
|
|
|
volume={controlsState.volume} |
|
|
|
icon={ |
|
|
|
changeCurrentVolume={changeCurrentVolume} |
|
|
|
<Broadcast |
|
|
|
slideCurrentVolume={slideCurrentVolume} |
|
|
|
iconClass="fullScreen" |
|
|
|
clearVolumeInterval={clearVolumeInterval} |
|
|
|
fill="#fff" |
|
|
|
isMuted={controlsState.isMuted} |
|
|
|
className="hover-icon-animate" |
|
|
|
toggleVolume={toggleVolume} |
|
|
|
fontSize={'20px'} |
|
|
|
/> |
|
|
|
onClick={clientFullScreen} |
|
|
|
<SetComponent switchChange={switchChange} /> |
|
|
|
/> |
|
|
|
<Tooltip |
|
|
|
} |
|
|
|
styleCss={{ padding: '0 5px' }} |
|
|
|
/> |
|
|
|
title="截图" |
|
|
|
<Tooltip |
|
|
|
icon={ |
|
|
|
styleCss={{ padding: '0 5px' }} |
|
|
|
<Broadcast |
|
|
|
title={controlsState.isScreentFull ? '退出全屏' : '全屏'} |
|
|
|
iconClass="screenshot" |
|
|
|
icon={ |
|
|
|
className="hover-icon-animate" |
|
|
|
<Broadcast |
|
|
|
fill="#fff" |
|
|
|
iconClass="fullScreen" |
|
|
|
onClick={screenshot} |
|
|
|
fill="#fff" |
|
|
|
/> |
|
|
|
fontSize={'20px'} |
|
|
|
} |
|
|
|
onClick={requestFullScreen} |
|
|
|
/> |
|
|
|
className="hover-icon-animate" |
|
|
|
<Tooltip |
|
|
|
/> |
|
|
|
styleCss={{ padding: '0 5px' }} |
|
|
|
} |
|
|
|
title={isPictureinpicture ? '关闭画中画' : '开启画中画'} |
|
|
|
/> |
|
|
|
icon={ |
|
|
|
|
|
|
|
<Broadcast |
|
|
|
|
|
|
|
iconClass="fullScreen" |
|
|
|
|
|
|
|
fill="#fff" |
|
|
|
|
|
|
|
className="hover-icon-animate" |
|
|
|
|
|
|
|
fontSize={'20px'} |
|
|
|
|
|
|
|
onClick={pictureInPicture} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Tooltip |
|
|
|
|
|
|
|
styleCss={{ padding: '0 5px' }} |
|
|
|
|
|
|
|
title="网页全屏" |
|
|
|
|
|
|
|
icon={ |
|
|
|
|
|
|
|
<Broadcast |
|
|
|
|
|
|
|
iconClass="fullScreen" |
|
|
|
|
|
|
|
fill="#fff" |
|
|
|
|
|
|
|
className="hover-icon-animate" |
|
|
|
|
|
|
|
fontSize={'20px'} |
|
|
|
|
|
|
|
onClick={clientFullScreen} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
<Tooltip |
|
|
|
|
|
|
|
styleCss={{ padding: '0 5px' }} |
|
|
|
|
|
|
|
title={controlsState.isScreentFull ? '退出全屏' : '全屏'} |
|
|
|
|
|
|
|
icon={ |
|
|
|
|
|
|
|
<Broadcast |
|
|
|
|
|
|
|
iconClass="fullScreen" |
|
|
|
|
|
|
|
fill="#fff" |
|
|
|
|
|
|
|
fontSize={'20px'} |
|
|
|
|
|
|
|
onClick={requestFullScreen} |
|
|
|
|
|
|
|
className="hover-icon-animate" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
); |
|
|
|
); |
|
|
|
}, |
|
|
|
}); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
export default Index; |
|
|
|
export default Index; |
|
|
|