- Jun 6, 2020
- 257
- 1,070
xanoss
Here is a simple widget you can use to add new videos.
To use this widget, make a new passage in Twine named widgets or something. Then add the tagCode:<<widget vid>> <<set _path = "img/"+$args[0]+".mp4">> <<set _width = $args[1] ? $args[1] : 500>> <video autoplay @width=_width> <source @src=_path type="video/mp4"> </video> <</widget>>
widget
at the top and then add the widget code in the passage.
Then, to add a video with path img/bathroom/gf/vid1.mp4 in a passage, just do like this:<<vid bathroom/gf/vid1>>
and it will add the video with default width 500. If you want another width, just add the width:<<vid bathroom/gf/vid1 300>>
Note that I'm adding img/ and .mp4 to the path in the widget.
If you use webm, you have to change .mp4 to .webm (and the type to video/webm)
And, if you convert all your old animated webp to mp4 or webm, it would be pretty easy to make a script that replaced your old webp in the passages with the mp4/webm videos using the widget, including the width you used.
Okay Thank you thats easy for me to understand!