renpyweb icon indicating copy to clipboard operation
renpyweb copied to clipboard

[Feature Request] Support Webm video format

Open conanak99 opened this issue 2 years ago • 1 comments

What is this request

Currently, renpy web can not support videos. This is a feature request that renpy web can support and play video file format like webm

Why should we have this

Webm video are mostly used for animation, cut-scene… A lot of VNs with animated scene will benefit from this as it can be ported

Technical Challenge

Webm format is supported by most evergreen browsers so it shouldn’t be an issue https://caniuse.com/webm Based on my experience, browser will prevent auto play video with sound, so video should be muted, or require users to click the play button.

I’m a web developer myself, with some experience with Python. If the maintainer can give me some guideline, I’d love to create a PR for this 😄.

conanak99 avatar Jun 25 '22 16:06 conanak99

You might find Beuc notes about RenpyWeb interesting here (look for "video").

AFAIK, the autoplay feature is only blocked until the user interacts with the page, so it is not a problem with RenpyWeb (games would not be able to play any audio otherwise).

I'm not really a Renpy expert, but I guess you can start by creating a video channel class similar to the one for Android and make sure it is used instead of the default channel for video (same as for Android). This class would be the bridge between Renpy and the JS code that handles the video element (to put on top of the game canvas). Of course, this would only work for full-screen videos (no Renpy overlay and little interaction).

Better wait for @renpytom approval before starting to work on this PR though.

Tey avatar Jun 26 '22 00:06 Tey