Jump to content

play video


jahlxx

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
}
Link to comment
Share on other sites

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>
 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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>
 

Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
Share on other sites

  • 2 weeks later...

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

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...