Skip to content

Commit

Permalink
修正分享链接端口错误
Browse files Browse the repository at this point in the history
  • Loading branch information
langmansh committed Nov 18, 2022
1 parent abb72f6 commit da31d60
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 30 deletions.
12 changes: 8 additions & 4 deletions src/view/device/PlayForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ export default class PlayForm extends React.Component {
{
this.setState({
playUrl:{
flv:`${apiDomin}/`+this.state.channel.app+'/'+this.state.channel.mainId+'.live.flv',
hls:`${apiDomin}/`+this.state.channel.app+'/'+this.state.channel.mainId+'/hls.m3u8',
rtmp:`${apiDomin}/`+this.state.channel.app+'/'+this.state.channel.mainId,
rtsp:`${apiDomin}/`+this.state.channel.app+'/'+this.state.channel.mainId,
flv:res.data.playUrl[1],
hls:res.data.playUrl[4],
rtmp:res.data.playUrl[3],
rtsp:res.data.playUrl[2],
// flv:`${apiDomin}/`+this.state.channel.app+'/'+this.state.channel.mainId+'.live.flv',
// hls:`${apiDomin}/`+this.state.channel.app+'/'+this.state.channel.mainId+'/hls.m3u8',
// rtmp:`${apiDomin}/`+this.state.channel.app+'/'+this.state.channel.mainId,
// rtsp:`${apiDomin}/`+this.state.channel.app+'/'+this.state.channel.mainId,
}
})
}
Expand Down
57 changes: 33 additions & 24 deletions src/view/player/ZLPlayer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ReactTimeout from "react-timeout";
import classNames from "classnames";
import {apiDomin} from "../../config/apiconfig";
import AKStreamPlayer from '../../component/RvJessibuca/App.js';

import {StreamLive} from "../../service/channel";

@ReactTimeout
export default class ZLPlayer extends React.Component {
Expand Down Expand Up @@ -76,30 +76,39 @@ export default class ZLPlayer extends React.Component {
const ua = UAParser(global.navigator.userAgent);
this.channelParams = queryString.parse(this.props.location.search);

const {mediaServerIp, vhost, app, stream, iframe=false} = this.channelParams;
const urldata = {
play_addrs:{
flv:`${apiDomin}/`+app+'/'+stream+'.live.flv',
hls:`${apiDomin}/`+app+'/'+stream+'/hls.m3u8',
rtmp:`${apiDomin}/`+app+'/'+stream,
rtsp:`${apiDomin}/`+app+'/'+stream,
const {mediaServerIp,mediaServerId, vhost, app, stream, iframe=false} = this.channelParams;

StreamLive(mediaServerId,stream).then(res => {
if(res._success && res._statusCode === 200 && res.data)
{
const urldata = {
play_addrs:{
flv:res.data.playUrl[1],
hls:res.data.playUrl[4],
rtmp:res.data.playUrl[3],
rtsp:res.data.playUrl[2],
}
}

this.setState({
loading: true,
iframe
}, () => {
this.setState({
channelData: urldata,
currentUrl:urldata.play_addrs.flv,
params: this.channelParams,
}, () => {
this.changePlayType("flvjs")
})
this.setState({
loading: false,
})
})

}
}

this.setState({
loading: true,
iframe
}, () => {
this.setState({
channelData: urldata,
currentUrl:urldata.play_addrs.flv,
params: this.channelParams,
}, () => {
this.changePlayType("flvjs")
})
this.setState({
loading: false,
})


})

this.loadData(this.state.recordparams)
Expand Down
4 changes: 2 additions & 2 deletions src/view/plaza/Plaza.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ class MediaChannel extends React.Component {
}
console.log(snapshotPath)
// snapshotPath += "/"+ item.app+"/"+item.stream+".png"
snapshotPath += `${apiDomin}/`+item.app+"/"+item.mediaServerStreamInfo.stream+".flv"
snapshotPath += `${apiDomin}/`+item.app+"/"+item.mediaServerStreamInfo.stream+".live.flv"
return (
<List.Item className={"channel-py"}>
<div className={"channel-py-snap"} onClick={()=>{
const w=window.open('about:blank');
w.location.href=`/play?mediaServerIp=${item.mediaServerStreamInfo.mediaServerIp}&vhost=${item.vhost}&app=${item.app}&stream=${item.mediaServerStreamInfo.stream}`;
w.location.href=`/play?mediaServerIp=${item.mediaServerStreamInfo.mediaServerIp}&mediaServerId=${mediaServerId}&vhost=${item.vhost}&app=${item.app}&stream=${item.mediaServerStreamInfo.stream}`;
}}>
<RvImage src={snapshotPath} fallbackSrc={black}/>
</div>
Expand Down

0 comments on commit da31d60

Please sign in to comment.