Jump to content

UnimVideo1 Plays audio but no video until the video is clicked


tcoates

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...