我是PHP和JW播放器的新手.
我有以下代码在php中读取视频文件并在浏览器中将其作为视频文件播放:
loadfile.php
<?php
header("pragma : no-cache");
header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header("Content-Description: File Transfer");
header("Content-Type: video/mp4");
header("Content-Location: videos/testvid.mp4");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize("videos/testvid.mp4"));
readfile("videos/testvid.mp4");
?>
Run Code Online (Sandbox Code Playgroud)
JW播放器可以通过直接路径播放视频文件,如下所示:
<div id="mediaplayer"></div>
<script type="text/javascript">
jwplayer('mediaplayer').setup({
'flashplayer': 'jwplayer/jwplayer.swf',
'file': 'videos/testvid.mp4',
'id': 'playerID',
'width': '480',
'height': '320'
});
</script>
Run Code Online (Sandbox Code Playgroud)
但是,我需要jw播放器在loadfile.php中播放视频而不是直接路径.换句话说,我需要在流式传输后将视频传递给JW播放器并在php中读取.我怎样才能做到这一点?
更新:
我正在使用JW 6
我有以下实体类:
@Entity
@Table(name = "THE_TREE", catalog = "", schema = "dbo")
public class TheTree implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name = "ID", nullable = false)
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@Column(name = "NODE_NAME")
private String name;
@Column(name = "LEVEL")
private int level;
@OneToMany
@JoinColumn(name="PARENTID")
public List<TheTree > children = new LinkedList<TheTree >();
Run Code Online (Sandbox Code Playgroud)
我想将其表示为primefaces树,但我无法做到正确.primefaces网站中给出的示例具有预定义深度的静态节点,其中我需要具有未知深度的节点并从数据库填充.我在这里看过各种帖子,但对我来说没什么好看的.在这篇文章中,似乎作者提出了同样的问题,但答案与某个问题无关.任何解决方案将不胜感激.
我正在尝试使用EJB远程调用,但是我收到了一个错误.我有一个名为的Web应用程序调用CallerApp另一个名为的Web应用程序中的方法RecieverApp.
在CallerApp我有一个远程接口:
@Remote
public interface ControllerRemote {
public int perform(int i);
}
Run Code Online (Sandbox Code Playgroud)
并且在此课程中执行调用:
public class Talker {
@EJB private ControllerRemote remote;
//constructor and invoke setRemote() method to set remote
private void setRemote() throws Exception{
Properties p = new Properties();
Context jndiContext = new InitialContext(p);
Object ref = jndiContext.lookup("java:global/RecieverApp/Controller!bean.ControllerRemote");
remote = (ControllerRemote) PortableRemoteObject.narrow(ref, ControllerRemote.class);
}
public void action(){
remote.perform(5);
}
}
Run Code Online (Sandbox Code Playgroud)
RecieverApp在同一个Glassfish服务器上被拆除:
@Stateless
public class Controller implements Serializable, ControllerRemote{
@Override
public int perform(int i){
//return …Run Code Online (Sandbox Code Playgroud) 我在开发应用程序时遇到此错误
javax.el.MethodNotFoundException: /test.xhtml @18,99
action="#{ComplexeController.saveComplexe}": Method not found:
fr.code.parc.controller.ComplexeController@97aead.saveComplexe()
Run Code Online (Sandbox Code Playgroud)
test.xhtml:
<h:body>
<h1>Génération des Complexes</h1>
<h:form>
Nom Complexe: <h:inputText value="#{ComplexeController.complexe.nomComp}"/><br/>
Nom Zone: <h:selectOneMenu id="nomZone" value="#{ComplexeController.complexe.zoneParc}" converter="#{GenericConverter}">
<f:selectItems value="#{ZoneController.remplireItem()}"/>
</h:selectOneMenu>
<br/>
<h:commandButton action="#{ComplexeController.saveComplexe}" value="Insérer un nouveau complexe"/>
<h:commandButton action="#{ComplexeController.updateComplexe}" value="Modifier un complexe"/>
<br/>
<h:commandLink action="complexe" value="acceuil"/>
</h:form>
</h:body>
Run Code Online (Sandbox Code Playgroud)
实体Complexe.java
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
/**
* Complexe generated by hbm2java
*/
@Entity
@Table(name="COMPLEXE"
,schema="PROJET" …Run Code Online (Sandbox Code Playgroud) asRuleValue是 [^0-9a-zA-Z"'-.#, ]
Pattern classPattern = Pattern.compile(asRuleValue, Pattern.CASE_INSENSITIVE);
Matcher m = classPattern.matcher(asValue);
if (!m.find())
{
lbFlag = true;
}
Run Code Online (Sandbox Code Playgroud)
在某些情况下工作不正常,比如()我在这里做错了什么?
我在linux上编写了一个bash脚本,它运行良好,作为迁移的一部分,我将一个aix 7.2节点移动到我的集群中.当我尝试在aix上运行bash脚本时,它失败了,在不同的gnu bash命令上出现了多个错误.[ps:我在这个aix节点上安装了gnu bash,IBM称之为为aix制作的工具箱,其中包含为AIX IBM Systems构建的开源和GNU软件的集合]
例如 :
- grep -oP 不受支持
- ls -h 不起作用
- getopts无法获得参数传递$#.
我不确定我是否只是在aix上安装gnu bash.有没有人有任何将bash脚本移植到ssh的经验?是否有任何指针社区可以建议让bash脚本在aix上运行?
在JAX-RS(RestEasy)中,我想实现一个客户端过滤器,在发送请求之前修改标头,因此我不会为每次调用手动执行此操作.
目前我在接收端这样做是为了在到达资源之前拦截请求.
@Provider
@Priority(Priorities.AUTHENTICATION)
public class AuthenticationFilter implements ContainerRequestFilter {
@Override
public void filter(ContainerRequestContext requestContext) throws IOException {
// read header
}
Run Code Online (Sandbox Code Playgroud)
现在我知道了(如果我错了,纠正我):
在接收端,ContainerRequestFilter可以在请求到达资源并获取请求之前使用.
但我想在客户端实现这一点,在请求发送到服务器之前修改标头.可以使用相同的服务器过滤器,还是有类似于客户端的东西?
我希望所有名字都以特定字符开头.
例:
char = 'C'
Run Code Online (Sandbox Code Playgroud)
名字: Chal,Chess,Arter,Bain,Dave
结果: Chal,Chess