I have two kinds, one is video kind and the other is a custom kind which contains a video kind. I want to pass a parameter videoStream into the kind VideoPlayerPage and have the subkind Video set this parameter as its src. How do I do this ?
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);
}
});
Nevermind I figured it out . I gave my Video kind a name "player" then in set it in the create function .
create : function(arg){
this.inherited(arguments);
this.$.player.setSrc(this.stream);
}