// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

const {ccclass, property} = cc._decorator;
cc.macro.ENABLE_TRANSPARENT_CANVAS = true
@ccclass
export default class Test extends cc.Component {
    // LIFE-CYCLE CALLBACKS:

    // onLoad () {}

    start () {
        this.node.on('touchend', this.onTouchPlay, this)
    }

    // update (dt) {}
    
    onTouchPlay() {
        const videoPlayer = this.node.getComponent(cc.VideoPlayer)
        videoPlayer.play();
    }
}
