Howdy, Stranger!

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

How to embed a video into Twine?

Is there a way to embed video into Twine ? And not from a website like youtube but a .mov file that's on your computer?

Comments

  • You can use a HTML video element to play video files.
    <video src="your-video-file.mov">
    Your web-browser does not support playing video files of this sort.
    </video>
    

    note: You may want to convert your mov file into a MP4 file, which has better web-browser support.
  • edited September 2015
    HTML5 disallows playing movies self-hosted from your computer for security reasons. There might be a plugin that gets around this, but the only ones I could find were paid ones.

    The easiest way to get movies to play without hassle is to convert the movie to a (high quality) swf and plug that in with swfobject: https://code.google.com/p/swfobject/.
  • Claretta wrote: »
    HTML5 disallows playing movies self-hosted from your computer for security reasons.
    If the HTML5 file and the video file are both located on your local hard-disk then the video will play, at least they will if the video is a webm file.

    Example of a basic test.html file:
    <!doctype html>
    <html lang="en">
    <head>
      <meta charset="utf-8">
      <title>WebM Test</title>
    </head>
    <body>
      <video width="640" height="400" autoplay>
        <source src="test.webm" type='video/webm; codecs="vp8, vorbis"'>
      </video>
    </body>
    </html>
    
  • That works, but I can't get any other video file to work. Also, webm files are huge. But it works.
  • MP4 also works in Chrome and Firefox on Windows using:
    <source src="test.mp4" type="video/mp4">
    
  • edited September 2015
    That works as soon as I change the files from the itunes format of m4v to mp4, thanks.

    No idea why avi isn't working, which is my normal format I like to make videos in.
  • Claretta wrote: »
    No idea why avi isn't working, which is my normal format I like to make videos in.
    Maybe because AVI is a container format and not a video codec.
    Do you know which codec is being used for the "movi" chunk? If it is one that is not widely supported by web-browsers/OS combinations then that could be why.
    Claretta wrote: »
    That works as soon as I change the files from the itunes format of m4v to mp4, thanks.
    Do you know if your m4v container files have the DRM turned on? If it is maybe that is what is causing your issue, or maybe it is the same issue as the AVI container. (eg not using a widely supported codec)
  • edited September 2015
    It was H.264, but otherwise don't know don't care really. :p Just wanted it to work. Thanks for your help!

    All I had to do was text rename m4v to mp4, so doubt it is a DRM issue. More like a player can't recognise m4v issue.
  • CX3CX3
    edited February 2016
    Claretta wrote: »
    HTML5 disallows playing movies self-hosted from your computer for security reasons.

    It seems to be the issue i have problems with no autplay functions working on weblinks.

    Does this mean there is no way, letting a video autoplay or stat at e.g. #t=1m20s ?in twine / html5?

    Is there any way to do it, e.g. with Javescript? How is such a function called and how must it look like? Because I´d really love to have a video/music play from the web in my twine story. its one of the last issues i am fighting with. I use Harlow, so far.

    Can anyone help me out?
Sign In or Register to comment.