Jump to content

play video


jahlxx

Recommended Posts

Hi, I have a question about video in HTML, sorry if it is not the right place to post.

 

I have this in a UniHTMLFrame:

 

<div id="video_container" align="center">
<video id="lab1_video" autoplay muted loop width="100%"> 
<source src="media/road1.mp4" type="video/mp4">
</video>
</div>
 
This code displays my video as a background in the frame, but when I resize browser window, video remains playing with old dimensions.
This same code as a pure html file works well when browser resizes.
 
Can you give me a hand on this, please?
Link to comment
Share on other sites

  • 2 weeks later...
  • 4 years later...

Hello!

I'm trying play YouTube video:

<!DOCTYPE html>
<html>
<body>

<iframe id="myVideo"  width="100%" height="100%">
  <src="https://youtu.be/z7vZUIi1pHw" allowfullscreen>
</iframe>

</body>
</html>

But, video not showing. 

UniHTMLFrame is empty:

image.png.e1fd1f36e1726e9b83da733a9bdd90de.png

Is it possible work? 

If "no", may be possible create a new browser window and put link to YouTube video in address string?

Link to comment
Share on other sites

6 hours ago, Артем said:

Hello!

I'm trying play YouTube video:


<!DOCTYPE html>
<html>
<body>

<iframe id="myVideo"  width="100%" height="100%">
  <src="https://youtu.be/z7vZUIi1pHw" allowfullscreen>
</iframe>

</body>
</html>

But, video not showing. 

UniHTMLFrame is empty:

image.png.e1fd1f36e1726e9b83da733a9bdd90de.png

Is it possible work? 

If "no", may be possible create a new browser window and put link to YouTube video in address string?

Hi

You should change your source to embedded one.

Please check https://developers.google.com/youtube/iframe_api_reference

Link to comment
Share on other sites

  • 3 years later...
On 10/3/2016 at 3:33 PM, Sherzod said:

 

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.

procedure TsnbxUnimCustomApp001MainForm.Run_PLAY(Sender: TObject);
begin
  var oForm:= TMainmForm(Form);
  oForm.Image1.Visible:= False;
  var oFrame:= oForm.UnimHTMLFrame1;
  oFrame.HTML.Text:=
  '<!DOCTYPE html> '+
  ' <html>'+
  ' <body>'+
//  ' <video id="video01" width= "100%" height="100%" controls muted loop autoplay>'+
  ' <video id="video01" width= "100%" height="100%" muted loop autoplay>'+
  '    <source src="files/video01.mp4" type="video/mp4">'+
  ' </video>'+
  ' </body>'+
  ' </html>

While Video Playing..if user Click on HTLMFrame (Video),

How to  Stop Playing?  or How to Stop Playing with Code? 

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.

×
×
  • Create New...