我有两种,一种是视频类,另一种是包含视频类的定制类。我想将一个参数videoStream传递到VideoPlayerPage类型中,并将子类视频设置为src。我该怎么做?
var el = new VideoplayerPage({stream: videoStream });
el.renderInto(document.getElementById("formContainer")); enyo.kind({
name: "Videoplayer",
kind : "Video",
style: "margin-top: 100px;",
poster : null,
src : null
});
enyo.kind({
name: "VideoplayerPage",
kind: "FittableRows",
style: "margin-top: 100px;",
published: {
stream : null
},
create : function(){
this.inherited(arguments);
this.streamChanged();
console.log("Creating video page"+ this.stream);
},
classes: "data-grid-list-sample data-repeater-sample enyo-fit",
components : [
{kind : "Videoplayer", src: this.stream, showControls : true, fitToWindow : true, autoplay :true},
{tag: "br"},
{kind : "moon.Button"},
{kind : "moon.Button"}
],
streamChanged: function() {
//this.$.stream.setContent(this.stream);
this.setStream(this.stream);
}
});发布于 2014-03-26 15:50:29
不介意我想出来了。我给我的视频类命名为"player“,然后在create函数中设置它。
create : function(arg){
this.inherited(arguments);
this.$.player.setSrc(this.stream);
}https://stackoverflow.com/questions/22664832
复制相似问题