这是代码:创建视频播放器(QuickTime的浏览器插件)反应的元素,输出丢失的视频性能
render: function() {
switch (this.state.mime) {
case "image":
return React.createElement("img", React.__spread({}, this.props, { className: "img-responsive",
src: this.state.url }));
case "iframe":
return React.createElement("iframe", React.__spread({}, this.props, { src: this.state.url }));
case "rtmp":
return React.createElement("embed", React.__spread({}, this.props, { src: this.state.streamUrl,
type: "video/quicktime",
autoPlay: true,
qtsrc: this.state.streamUrl,
target: "myself",
scale: "tofit",
controller: false,
pluginspage: "http://www.apple.com/quicktime/download/",
loop: "false" }));
default:
return React.createElement("span", null);
}
}
这是所需的输出:
<embed class="embed-responsive-item" src="rtsp://usr:[email protected]:10012" type="video/quicktime" autoplay="true" qtsrc="rtsp://10.0.1.12:10012" target="myself" scale="tofit" controller="false" pluginspage="http://www.apple.com/quicktime/download/" loop="false" data-reactid=".0.0.1.1.0.0.0.0">
,这里是我所得到的:
<embed class="embed-responsive-item" src="rtsp://usr:[email protected]:10012" type="video/quicktime" autoplay="" target="myself" loop="" data-reactid=".0.0.1.1.0.0.0.0">
- 缺失的元素:自动播放值,qtsrc和值,缩放,控制器,插件页面和值,循环值;无法弄清原因。提前感谢您的帮助!
http://facebook.github.io/react/docs/jsx-gotchas.html#custom -html-attributes – Dhiraj 2015-02-17 23:51:45
谢谢!我尝试了 - 但很显然我错过了一些东西 - 它只是不会发生......它甚至会停止渲染 – Yatko 2015-02-18 00:02:43
我做了这样的事情http://jsbin.com/viveci/2/ – Dhiraj 2015-02-18 00:06:59