首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >引用enyo.kind()中的参数

引用enyo.kind()中的参数
EN

Stack Overflow用户
提问于 2014-03-26 14:56:30
回答 1查看 223关注 0票数 0

我有两种,一种是视频类,另一种是包含视频类的定制类。我想将一个参数videoStream传递到VideoPlayerPage类型中,并将子类视频设置为src。我该怎么做?

代码语言:javascript
复制
var el  =  new VideoplayerPage({stream: videoStream });
el.renderInto(document.getElementById("formContainer")); 

代码语言:javascript
复制
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);
    }
});
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-03-26 15:50:29

不介意我想出来了。我给我的视频类命名为"player“,然后在create函数中设置它。

代码语言:javascript
复制
create : function(arg){
        this.inherited(arguments); 
        this.$.player.setSrc(this.stream);
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22664832

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档