tcoates Posted October 31, 2016 Share Posted October 31, 2016 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 More sharing options...
Sherzod Posted October 31, 2016 Share Posted October 31, 2016 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 More sharing options...
tcoates Posted November 1, 2016 Author Share Posted November 1, 2016 That worked. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now