我正在使用 Eclipse Indigo 和 primefaces JSF 我有两个来自文件的不同流视频。要获得使用:
@ManagedBean
@SessionScoped
public class pruebaControlador{
private StreamedContent myVideo; // + setter & Getter
private StreamedContent myVideo2; // + setter & Getter
public void videoInputStream(){
try{
inputStream = new FileInputStream("c://folder//video1.mp4");
myVideo = new DefaultStreamedContent(inputStream,"video/quicktime");
inputStream2 = new FileInputStream("c://folder//video2.mp4");
myVideo2 = new DefaultStreamedContent(inputStream2,"video/quicktime");
}Catch(Exception e){
e.printStackTrace();
}
}
}
到目前为止,一切都很好...
我的 jsf 包含以下内容:
<ui:define name="contentCenter">
<h:form id="formCenter" enctype="multipart/form-data"
prependId="false">
<h:panelGrid columns="1" id="panelVideo">
<p:media id="video" value="#{pruebaControlador.myVideo}"
width="800" height="600" player="quicktime">
<f:param name="scale" value="tofit" />
<f:param name="autoPlay" value="true" />
<f:param name="controller" value="true" />
<f:param name="loop" value="false" />
<f:param name="volume" value="50" />
<f:param name ="qtnext1" value="<#{pruebaControlador.myVideo2}> T<myself>" />
</p:media>
</h:panelGrid>
</h:form>
</ui:define>
但是没有打开视频2,显然没有找到存储video2 Stream的URL