|
@ -1,5 +1,6 @@ |
|
|
import React, { useEffect, useState } from 'react'; |
|
|
import React, { useEffect, useState } from 'react'; |
|
|
import { connect } from 'react-redux'; |
|
|
import { connect } from 'react-redux'; |
|
|
|
|
|
import qs from "qs"; |
|
|
import { VideoPlay } from '$components' |
|
|
import { VideoPlay } from '$components' |
|
|
import '../style.less' |
|
|
import '../style.less' |
|
|
|
|
|
|
|
@ -7,6 +8,15 @@ const VideoPlayCross = (props) => { |
|
|
const [videoParams, setVideoParams] = useState(null) |
|
|
const [videoParams, setVideoParams] = useState(null) |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
|
|
|
if (props.location.search) { |
|
|
|
|
|
const params = qs.parse(props.location.search.slice(1)) |
|
|
|
|
|
if (params.videoObj) { |
|
|
|
|
|
params.videoObj = (new Function("return " + params.videoObj))() |
|
|
|
|
|
setVideoParams(params) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function messageListen (e) { |
|
|
function messageListen (e) { |
|
|
// 此处需做 域名 验证 |
|
|
// 此处需做 域名 验证 |
|
|
const { data } = e |
|
|
const { data } = e |
|
@ -16,7 +26,6 @@ const VideoPlayCross = (props) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (window.parent) { |
|
|
if (window.parent) { |
|
|
window.addEventListener('message', messageListen); |
|
|
window.addEventListener('message', messageListen); |
|
|
} |
|
|
} |
|
|