请教大神们一个问题,就是想用XUNRUI做一个视频网站。但是因为视频不在本地服务器,想调用远程视频文件实现在线播放。然后想在内容页只需要修改红色的地址就能播放。
http://www.demo1.com/video.html?player=http://demo2.com/demo.mp4
当前用的代码如下,player自定义内容能在页面显示,但是src= 就不能解析了,有人可以帮助一下吗?
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>播放页面</title>
<script type="text/javascript">
function QueryString(item){
var sValue=location.search.match(new RegExp("[\?\&]"+item+"=([^\&]*)(\&?)","i"))
return sValue?sValue[1]:sValue
}
var lusername=QueryString("player");
</script>
</head>
<body>
<video width="320" height="240" controls>
<source src="<script>var b=document;var c=lusername;b.write(c);</script>" type="video/mp4">
您的浏览器不支持Video标签。 </video>
<script>var b=document;var c=lusername;b.write(c);</script>当前输入的内容显示
</body>
</html>
那么,打开控制器文件,将payer参数传入模板,并设置模板是哪一个
访问前端:/index.php?s=news&c=play,会提示缺少模板xxxx
然后,按要求创建player.html
<!doctype html> <html> <head> <meta charset="utf-8"> <title>播放页面</title> <script type="text/javascript"> function QueryString(item){ var sValue=location.search.match(new RegExp("[\?\&]"+item+"=([^\&]*)(\&?)","i")) return sValue?sValue[1]:sValue } var lusername=QueryString("player"); </script> </head> <body> <video width="320" height="240" controls> <source src="{$player}" type="video/mp4"> 您的浏览器不支持Video标签。 </video> </body> </html>