因此,我需要在视频播放结束后启用关闭按钮。我看了一下render方法,但是我遇到了麻烦,希望能提供帮助
//Helper
addListeners: function(component, event) {
var cmp = component.find("video").get("v.value");
cmp.getElement().addEventListener('ended', videoEndHandler, false);
function videoEndHandler(e) {
console.log("opaaaaaaaaaa");
}
}
//Renderer
({
afterRender: function (component, helper) {
var afterRend = this.superAfterRender();
helper.addListeners(component)
return afterRend;
},
})
<aura:handler name="render" value="{!this}" action="{!c.onRender}" />
<!-- Modal Body -->
<div>
<aura:if isTrue="{!v.profile == '00ef4000000lYoJAAU'}">
<div class="slds-modal__content slds-p-around_medium">
<section class="slds-align_absolute-center" style="height:auto">
<iframe id='video' src="https://player.vimeo.com/video/398893657" width="640" height="283" frameborder="0" allow="fullscreen"></iframe>
</section>
</div>
</aura:if>