Mp4 file in form

Put an mp4 file into a form as a video for viewing

I can make an mp4 file and save it to a table, what I don’t know how to accomplish is to make that video show up in a component on the form.

This is a common question, maybe search the forum and see what solutions other people have already posted?

1 Like

Okay, looked for mp4 in forum, but no solution to this problem. Nice that ffmpeg is installed on anvil, that made it possible for me to use FFMpegWriter from matplotlib.animation to save the mp4 and to put it into a datatable as media. I have downloaded it, and it is as it should be.

But displaying that mp4 in a form is what I cannot solve.

Do a search on “play video” on the forum.

Anvil apps are HTML apps, and as such playing videos is the same as as in any HTML based app. Some helpful people have posted their solutions on the forum to playing videos.

1 Like

Yeah. I guess I’ll have to use some time to setup some cdn js player and then figure out how to place the player in a form and use some python–>js and js–>python to load the video from the table into the js cdn player. Good anvice to search for ‘play video’, many nuggets there.

Yes, I did it! The video was in a table, and I searched it up, after creating it with python server code. Then I placed the video in a media object, and made a call to the video player script, using the dot url method. But out of time right now, gotta go to work. I’ll report on it later. Have a nice day, and thank you again.

1 Like