jahlxx Posted October 2, 2016 Posted October 2, 2016 hi. how can I play a video in a unigui app? thanks. Quote
Hayri ASLAN Posted October 2, 2016 Posted October 2, 2016 Add UniHtmlFrame to form. Put this to Unihtmlframe.html.text <!DOCTYPE html> <html> <body> <video width="400" controls> <source src="files/mov_bbb.mp4" type="video/mp4"> </video> </body> </html> Quote
jahlxx Posted October 2, 2016 Author Posted October 2, 2016 Ok. The video is displayed. Thanks. Some option to autostart? And close the frame when finished? Thanks. Quote
Sherzod Posted October 2, 2016 Posted October 2, 2016 Some option to autostart? Hi, <video autoplay="autoplay"> </video> Best regards. Quote
jahlxx Posted October 3, 2016 Author Posted October 3, 2016 Ok. Thanks to Hayri Aslan and Delphi Developer. And how to control the end of the video. I'm trying to show a video in my app, with the typical button "skip video", and starts auto. This is ok. But I don't know how to control the end of the video to show the mainform when the video is finished. Thanks. Quote
Sherzod Posted October 3, 2016 Posted October 3, 2016 But I don't know how to control the end of the video to show the mainform when the video is finished. Hi, Can you try this?! For example: <video src="video.ogv" id="myVideo"> video not supported </video> <script type='text/javascript'> document.getElementById('myVideo').addEventListener('ended',myHandler,false); function myHandler(e) { // What you want to do after the event // ajaxRequest(...); } </script> http://stackoverflow.com/questions/2741493/detect-when-an-html5-video-finishes Best regards. Quote
jahlxx Posted October 3, 2016 Author Posted October 3, 2016 I want to set a panel visible to false, but I don't know how to put the code inside the script. Quote
Sherzod Posted October 3, 2016 Posted October 3, 2016 I want to set a panel visible to false, but I don't know how to put the code inside the script. function myHandler(e) { MainForm.UniPanel1.setVisible(false); // or MainForm.UniPanel1.hide(); // or use ajaxRequest } Quote
jahlxx Posted October 3, 2016 Author Posted October 3, 2016 Sorry, dont' works. This is my html sting of the htmlframe for the video: <!DOCTYPE html><html><body><video controls autoplay> <source src="files/traza.mp4" type="video/mp4" id="myVideo"></video><script type='text/javascript'> document.getElementById('myVideo').addEventListener('ended',myHandler,false); function myHandler(e) { MainForm.panelvideo.setVisible(false); // What you want to do after the event // ajaxRequest(...); }</script></body></html> Quote
Sherzod Posted October 3, 2016 Posted October 3, 2016 Please pay attention to the case of letters! Is it correct - MainForm.panelvideo ?! Quote
jahlxx Posted October 3, 2016 Author Posted October 3, 2016 and do a button click? it could be more easy? Quote
Sherzod Posted October 3, 2016 Posted October 3, 2016 <video controls autoplay> <source src="files/traza.mp4" type="video/mp4" id="myVideo"></video> Correct: <video id="myVideo" controls autoplay> <source src="files/traza.mp4" type="video/mp4"> </video Quote
jahlxx Posted October 3, 2016 Author Posted October 3, 2016 Some help with differents video formats? In mp4 format I can't see it in an android device or iexplorer. I'll need to have the same video in differents formats, but I don't know witch formats I need. Some experience with this? One solution could be to have a video in youtube? If yes, I don't know how to show a youtube video inside a unigui app, and control the starts and the end of the video. Some help will be wellcome. Thanks. Quote
Oliver Morsch Posted October 3, 2016 Posted October 3, 2016 Some help with differents video formats? http://caniuse.com/#search=video Quote
jahlxx Posted October 3, 2016 Author Posted October 3, 2016 and the option of show a youtube video? could be better? Quote
jahlxx Posted October 3, 2016 Author Posted October 3, 2016 with this in the html string of the unihtmlpanel, works, but don't detect the end of the video. <!DOCTYPE html><html><body><iframe id="myVideo" width="100%" height="100%" src="https://www.youtube.com/embed/XXXXXXXXXXXXXXX?autoplay=1&rel=0"allowfullscreen </iframe><script type='text/javascript'> document.getElementById('myVideo').addEventListener('ended',myHandler,false); function myHandler(e) { MainForm.panelvideo.setVisible(false); MainForm.panelchart.setVisible(true); MainForm.panelchart.collapse(); }</script></body></html> Quote
Sherzod Posted October 4, 2016 Posted October 4, 2016 with this in the html string of the unihtmlpanel, works, but don't detect the end of the video. "ended" is an event of the video tag, not iframe Quote
PALF Posted December 1, 2016 Posted December 1, 2016 Hello I try with <video id="myVideo" controls autoplay> <source src="files/traza.mp4" type="video/mp4"> </video and show video ok. But, if try with position time trackbar, don't advance or rewind. How do i change video time position? Thank's in advance Quote
PALF Posted December 1, 2016 Posted December 1, 2016 Yes. In Firefox works ok. Is it possible to fix it in Chrome?? Quote
PALF Posted December 14, 2016 Posted December 14, 2016 Hello: I try to play wmv video with this code, but not show in Chrome or Firefox: <!DOCTYPE html> <html> <body> <video width="400" controls autoplay> <source src="media/2.wmv" type="video/x-ms-wmv"> </video> </body> </html> Thank's Quote
Sherzod Posted December 14, 2016 Posted December 14, 2016 Hi, Seems In HTML5, there are 3 supported video formats: MP4, WebM, and Ogg. http://www.w3schools.com/html/html5_video.asp Best regards. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.