开发者

iFraming a page with streaming video - video does not display

开发者 https://www.devze.com 2023-04-11 07:25 出处:网络
I am trying to iframe a page containing a streaming video. The streaming video does not work when I view the iframe. It works fine when the original page is viewed directly in browser. What am I missi

I am trying to iframe a page containing a streaming video. The streaming video does not work when I view the iframe. It works fine when the original page is viewed directly in browser. What am I missing here? Is the stremaing video protected by some mechanism that does not let is display within the iframe? Please also suggest any alternative solution to be able to display external streaming videos on my site. Thanks! The iframe code is

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <BODY>
  <iframe src="h开发者_开发技巧ttp://aajtak.intoday.in/livetv.php" width='800px' height='1000px' />
 </BODY>
</HTML>


In your screenshot, you are showing you are trying this from a file:// URL.

I don't know which security shenanigans are involved (The browser's or Flash's), but I'm fairly sure it will go away if you use a http:// URL instead.

Working JSFiddle


It's because of Cross Origin problem. Since you are using file://, it cannot play the video from 'http://' or 'https://'. If you can run your page in 'http://' or 'https://' at localhost, you will make it easy to work. In addition, if it does not work, you can set 'cross-origin' as 'anonymous'.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号