Jump to content

UnimVideo1 Plays audio but no video until the video is clicked


tcoates
 Share

Recommended Posts

I'm trying to play a video when a form opens. The issue I'm having is that, although the audio plays successfully, you cannot see the video component (you just get a black screen), until you click on the video itself. I found this link...

 

https://www.sencha.com/forum/showthread.php?262705-Ext-Video-Plays-audio-but-no-video-until-the-video-is-clicked

 

which includes...

 

Ext.define('MyVideo', {
    extend : 'Ext.Video',
    xtype  : 'myvideo',

    //hides poster, shows media
    onPlay : function() {
        this.callParent(arguments);

        if (!this.isInlineVideo) {
            this.ghost.hide();
            this.media.show();
        }
    },

    //hides media, shows poster
    onEnd : function() {
        this.callParent(arguments);

        if (!this.isInlineVideo) {
            this.media.hide();
            this.ghost.show();
        }
    }
});

 

How can I incorporate the above code into UnimVideo1 component?

 

Thanks,

Tim

Link to comment
Share on other sites

Hi,

 

For now you can use this, try:

procedure TMainmForm.UnimVideo1Ended(Sender: TObject);
begin
  UniSession.AddJS('var me=' + TUnimVideo(Sender).JSName + '; if (!me.isInlineVideo){me.media.hide();me.ghost.show()}');
end;

procedure TMainmForm.UnimVideo1Play(Sender: TObject);
begin
  UniSession.AddJS('var me=' + TUnimVideo(Sender).JSName + '; if (!me.isInlineVideo){me.ghost.hide();me.media.show()}');
end;

Best regards.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...