Primefaces show video generated in bean

In my application, I'd like to show a Youtube video with using the <p:media> component. The media component gets the video URL from a managed bean.

XHTML

<form>
    <p:media value="#{bean.printVideoLink()}"  width="240" height="160">
</form>

Managed Bean

public String printVideoLink() {
    return "https://www.youtube.com/v/Vg6P5nWIVjw";
}

But I'm getting an

IllegalArgumentException Cannot resolve mediaplayer for media component 'j_idt15', cannot play source:https://www.youtube.com/v/Vg6P5nWIVjw`

Any idea how to solve this error or are there any other ways how to include videos on runtime to the page?


我认为你需要提供玩家的类型作为<p:media>的属性

<p:media value="#{bean.printVideoLink()}" width="240" height="160" player="flash" />
链接地址: http://www.djcxy.com/p/68554.html

上一篇: 在javascript中获取primefaces widgetVar并更新它

下一篇: Primefaces显示在bean中生成的视频