|  | @ -2,6 +2,8 @@ import React, { useState, useEffect, useRef } from "react"; | 
			
		
	
		
		
			
				
					|  |  | import { connect } from "react-redux"; |  |  | import { connect } from "react-redux"; | 
			
		
	
		
		
			
				
					|  |  | import screenfull from 'screenfull'; |  |  | import screenfull from 'screenfull'; | 
			
		
	
		
		
			
				
					|  |  | import moment from "moment"; |  |  | import moment from "moment"; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import request from 'superagent' | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import { VideoServeApi, IotVideoServerRequest } from '$utils' | 
			
		
	
		
		
			
				
					|  |  | import VideoHeader from './voiceHeader' |  |  | import VideoHeader from './voiceHeader' | 
			
		
	
		
		
			
				
					|  |  | import VideoOperation from './videoOperation' |  |  | import VideoOperation from './videoOperation' | 
			
		
	
		
		
			
				
					|  |  | import './videoPlay.less'; |  |  | import './videoPlay.less'; | 
			
		
	
	
		
		
			
				
					|  | @ -15,7 +17,9 @@ const VideoPlay = ({ | 
			
		
	
		
		
			
				
					|  |  |    height, width, containerId = 'myPlayer', |  |  |    height, width, containerId = 'myPlayer', | 
			
		
	
		
		
			
				
					|  |  |    // playUrl, |  |  |    // playUrl, | 
			
		
	
		
		
			
				
					|  |  |    name, |  |  |    name, | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |    // videoObj, |  |  |    // videoObj, | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |    // videoObj = { |  |  |    // videoObj = { | 
			
		
	
		
		
			
				
					|  |  |    //    type: 'yingshi', |  |  |    //    type: 'yingshi', | 
			
		
	
		
		
			
				
					|  |  |    //    audio: false, |  |  |    //    audio: false, | 
			
		
	
	
		
		
			
				
					|  | @ -27,15 +31,19 @@ const VideoPlay = ({ | 
			
		
	
		
		
			
				
					|  |  |    //    playUrlHd: 'ezopen://open.ys7.com/G75922040/1.hd.live', |  |  |    //    playUrlHd: 'ezopen://open.ys7.com/G75922040/1.hd.live', | 
			
		
	
		
		
			
				
					|  |  |    //    // replayUrl: 'ezopen://open.ys7.com/G75922040/1.rec', |  |  |    //    // replayUrl: 'ezopen://open.ys7.com/G75922040/1.rec', | 
			
		
	
		
		
			
				
					|  |  |    // }, |  |  |    // }, | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |    videoObj = { |  |  |    videoObj = { | 
			
		
	
		
		
			
				
					|  |  |       type: 'cascade', |  |  |       type: 'cascade', | 
			
		
	
		
		
			
				
					|  |  |       audio: false, |  |  |       audio: false, | 
			
		
	
		
		
			
				
					
					|  |  |       serialNo: 'G75922040', // 设备序列号 必须 |  |  |       serialNo: '34020000001310000001', // 设备序列号 必须 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |       topSerialNo: 'G75922040', // 设备顶级序列号 必须 |  |  |       topSerialNo: '34020000001110000077', // 设备顶级序列号 必须 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |       playUrlSd: 'ws://221.230.55.27:8081/jessica/34020000001110000077/34020000001310000003', // 必须 |  |  |       playUrlSd: 'ws://221.230.55.27:8081/jessica/34020000001110000077/34020000001310000001', // 必须 | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |       // playUrlHd: 'ezopen://open.ys7.com/G75922040/1.hd.live', |  |  |       // playUrlHd: 'ezopen://open.ys7.com/G75922040/1.hd.live', | 
			
		
	
		
		
			
				
					|  |  |       // replayUrl: 'ezopen://open.ys7.com/G75922040/1.rec', |  |  |       // replayUrl: 'ezopen://open.ys7.com/G75922040/1.rec', | 
			
		
	
		
		
			
				
					|  |  |    }, |  |  |    }, | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |    // | 
			
		
	
		
		
			
				
					|  |  |  |  |  |    iotVideoServer | 
			
		
	
		
		
			
				
					|  |  | }) => { |  |  | }) => { | 
			
		
	
		
		
			
				
					|  |  |    console.log(videoObj); |  |  |    console.log(videoObj); | 
			
		
	
		
		
			
				
					|  |  |    const [jessibuca, setjessibuca] = useState(null) |  |  |    const [jessibuca, setjessibuca] = useState(null) | 
			
		
	
	
		
		
			
				
					|  | @ -211,8 +219,23 @@ const VideoPlay = ({ | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |    const createJessibuca = async () => { |  |  |    const createJessibuca = async () => { | 
			
		
	
		
		
			
				
					|  |  |       if (videoObj.type != 'yingshi') { |  |  |       if (videoObj.type != 'yingshi') { | 
			
		
	
		
		
			
				
					
					|  |  |           |  |  |          try { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |          let $container = document.getElementById('container'); |  |  |             // const inviteRes = await IotVideoServerRequest.get(VideoServeApi.invite, { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |             //    id: '36011200002002021114', | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             //    channel: '36011200581314002900' | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             // }).then(res => { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             //    console.log(res); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             // }, err => { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             //    console.log(err); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             // }) | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             const inviteRes_ = await request.get(`${iotVideoServer}/api/gb28181/invite?id=${videoObj.topSerialNo}&channel=${videoObj.serialNo}`) | 
			
		
	
		
		
			
				
					|  |  |  |  |  |          } catch (error) { | 
			
		
	
		
		
			
				
					|  |  |  |  |  |             console.log(error.response); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |          } | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |          let $container = document.getElementById(containerId); | 
			
		
	
		
		
			
				
					|  |  |          const jessibuca = new window.Jessibuca({ |  |  |          const jessibuca = new window.Jessibuca({ | 
			
		
	
		
		
			
				
					|  |  |             container: $container, |  |  |             container: $container, | 
			
		
	
		
		
			
				
					|  |  |             videoBuffer: 0.2, // 缓存时长 |  |  |             videoBuffer: 0.2, // 缓存时长 | 
			
		
	
	
		
		
			
				
					|  | @ -220,18 +243,18 @@ const VideoPlay = ({ | 
			
		
	
		
		
			
				
					|  |  |             text: "", |  |  |             text: "", | 
			
		
	
		
		
			
				
					|  |  |             loadingText: "加载中", |  |  |             loadingText: "加载中", | 
			
		
	
		
		
			
				
					|  |  |             debug: true, |  |  |             debug: true, | 
			
		
	
		
		
			
				
					
					|  |  |             showBandwidth: true, // 显示网速 |  |  |             showBandwidth: false, // 显示网速 | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |             operateBtns: { |  |  |             operateBtns: { | 
			
		
	
		
		
			
				
					
					|  |  |                fullscreen: true, |  |  |                fullscreen: false, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                screenshot: true, |  |  |                screenshot: false, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                play: true, |  |  |                play: false, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |                audio: true, |  |  |                audio: false, | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |             }, |  |  |             }, | 
			
		
	
		
		
			
				
					|  |  |             forceNoOffscreen: false, |  |  |             forceNoOffscreen: false, | 
			
		
	
		
		
			
				
					|  |  |             isNotMute: false, |  |  |             isNotMute: false, | 
			
		
	
		
		
			
				
					|  |  |          }); |  |  |          }); | 
			
		
	
		
		
			
				
					|  |  |          setjessibuca(jessibuca) |  |  |          setjessibuca(jessibuca) | 
			
		
	
		
		
			
				
					
					|  |  |          play() |  |  |          play({ jessibuca }) | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |       } |  |  |       } | 
			
		
	
		
		
			
				
					|  |  |    } |  |  |    } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  | @ -240,11 +263,12 @@ const VideoPlay = ({ | 
			
		
	
		
		
			
				
					|  |  |       // setIsPlaying(operation == 'play') |  |  |       // setIsPlaying(operation == 'play') | 
			
		
	
		
		
			
				
					|  |  |    } |  |  |    } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |    const play = () => { |  |  |    const play = (params) => { | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |       if (videoObj.type == 'yingshi') { |  |  |       if (videoObj.type == 'yingshi') { | 
			
		
	
		
		
			
				
					|  |  |          yingshiOperation('play') |  |  |          yingshiOperation('play') | 
			
		
	
		
		
			
				
					
					|  |  |       } else if (jessibuca && videoObj.playUrlSd) { |  |  |       } else if ((params.jessibuca || jessibuca) && videoObj.playUrlSd) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |          jessibuca.play(videoObj.playUrlSd); |  |  |          const jes = params.jessibuca || jessibuca | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |          jes.play(videoObj.playUrlSd); | 
			
		
	
		
		
			
				
					|  |  |          setIsPlaying(true) |  |  |          setIsPlaying(true) | 
			
		
	
		
		
			
				
					|  |  |       } |  |  |       } | 
			
		
	
		
		
			
				
					|  |  |    } |  |  |    } | 
			
		
	
	
		
		
			
				
					|  | @ -276,7 +300,7 @@ const VideoPlay = ({ | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |    return ( |  |  |    return ( | 
			
		
	
		
		
			
				
					|  |  |       <> |  |  |       <> | 
			
		
	
		
		
			
				
					
					|  |  |          <div className="vcmp_videoplay" style={{ height: height || '100%', width: width || '100%' }}> |  |  |          <div className="vcmp_videoplay" style={{ height: height || '100%', width: width || '100%', overflow: 'hidden' }}> | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |             <div id="vcmp_videoplay" style={{ position: 'relative', display: 'flex', height: '100%', width: '100%' }}> |  |  |             <div id="vcmp_videoplay" style={{ position: 'relative', display: 'flex', height: '100%', width: '100%' }}> | 
			
		
	
		
		
			
				
					|  |  |                {/* 顶部信息 */} |  |  |                {/* 顶部信息 */} | 
			
		
	
		
		
			
				
					|  |  |                <VideoHeader |  |  |                <VideoHeader | 
			
		
	
	
		
		
			
				
					|  | @ -306,7 +330,8 @@ const VideoPlay = ({ | 
			
		
	
		
		
			
				
					|  |  |                         wmode="transparent" |  |  |                         wmode="transparent" | 
			
		
	
		
		
			
				
					|  |  |                         style={{ pointerEvents: 'none' }} |  |  |                         style={{ pointerEvents: 'none' }} | 
			
		
	
		
		
			
				
					|  |  |                      /> : |  |  |                      /> : | 
			
		
	
		
		
			
				
					
					|  |  |                      <div id="container" |  |  |                      <div | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |                         id={containerId} | 
			
		
	
		
		
			
				
					|  |  |                         style={{ |  |  |                         style={{ | 
			
		
	
		
		
			
				
					|  |  |                            height: '100%', width: '100%' |  |  |                            height: '100%', width: '100%' | 
			
		
	
		
		
			
				
					|  |  |                         }}> |  |  |                         }}> | 
			
		
	
	
		
		
			
				
					|  | @ -337,9 +362,11 @@ const VideoPlay = ({ | 
			
		
	
		
		
			
				
					|  |  | } |  |  | } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | function mapStateToProps (state) { |  |  | function mapStateToProps (state) { | 
			
		
	
		
		
			
				
					
					|  |  |    const { auth } = state; |  |  |    const { auth, global } = state; | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |  |  |  |    console.log(global); | 
			
		
	
		
		
			
				
					|  |  |    return { |  |  |    return { | 
			
		
	
		
		
			
				
					|  |  |       user: auth.user, |  |  |       user: auth.user, | 
			
		
	
		
		
			
				
					|  |  |  |  |  |       iotVideoServer: global.iotVideoServer, | 
			
		
	
		
		
			
				
					|  |  |    }; |  |  |    }; | 
			
		
	
		
		
			
				
					|  |  | } |  |  | } | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
	
		
		
			
				
					|  | 
 |