Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Video with autoplay?

Hello everyone! :)
I'm creating a project using Twine 2 with Sugarcube 1.0.34, and there's a part where I want to play a local video (stored on the computer) with autoplay, so that when the passage loads the video will start playing automatically. Also, I DON'T want the video to have any kind of taskbar where you can pause, move forward, etc.
So, first I tried the most direct approach with this code:

<video src="videos/video1.mp4" width="640" height="480">
</video>

But it didn't have autoplay, naturally, so then I tried this:

<video controls autoplay>
<source src="videos/video1.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>

But this second version has a video taskbar with options like "play", etc.

So does anyone know how I could make the simpler version of the video (the first version, with no taskbar) start automatically when the passage loads, or how could I remove the options from the second video? I guess it must be pretty simple but I have no knowledge of HTML5 and I can't manage to figure it out... thanks a lot in advance! :)

Comments

  • edited January 2017
    Please use the code tag when posting code or markup—it's C on the editor bar.


    Look carefully at your second example. What do you suppose the controls attribute in it actually does? Remove it and the controls will go away. For example:
    <video autoplay>
    <source src="videos/video1.mp4" type="video/mp4">
    Your browser does not support the video tag.
    </video>
    


    For that matter, simply add the autoplay attribute, which you can also see in your second example, to your fist one and it should automatically play. For example:
    <video src="videos/video1.mp4" width="640" height="480" autoplay></video>
    


    SEE: HTML <video> element.
  • MadExile, you are a gentleman. Thank you so much :)
Sign In or Register to comment.