从BLOB获取视频,并使用<iframe>或<embed>标记使用struts2操作播放该视频

时间:2015-09-01 10:42:42

标签: html html5 jsp struts2 video-streaming

我可以使用&lt; s:url action ='downappsuservideo'/&gt; 成功打开从BLOB读取的视频,但是当我将它放入embed标签时它不起作用。

&#xA;&#xA;

如何在页面内播放?

&#xA;&#xA;
 &lt; embed src =“&lt; s:url action ='downappsuservideo'/&gt;” &#XA; type =“application / x-shockwave-flash”&#xA; pluginspage =“http://www.microsoft.com/Windows/MediaPlayer/”&#xA; name =“mediaplayer1”&#xA; ShowStatusBar =“true”&#xA; EnableContextMenu =“false”&#xA; width =“700”&#xA; height =“500”&#xA; autostart =“false”&#xA; loop =“false”&#xA; align =“middle”&#xA;体积= “60” &GT;&#XA; &LT; /嵌入&GT;&#XA;  
&#XA;

1 个答案:

答案 0 :(得分:0)

您不需要iframe或embed标记。只需使用HTML5 <video> tag这是新的标准方法:

<video src = "<s:url action='downappsuservideo'/>" 
  autoplay = "false"
     width = "700" 
    height = "500" 
      loop = "false" 
    poster = "posterimage.jpg">

  Sorry, your browser doesn't support embedded videos, 
  but don't worry, you can <a href="<s:url action='downappsuservideo'/>">download it</a>
  and watch it with your favorite video player!

</video>