rawpython / remi

Python REMote Interface library. Platform independent. In about 100 Kbytes, perfect for your diet.
Apache License 2.0
3.48k stars 401 forks source link

Excuse me.Why can't local video play? How should I use "VideoPlay "? Thank you very much! (just now, I've taken care of it... ) #489

Closed Antonio0307 closed 2 years ago

Antonio0307 commented 2 years ago

self.templatetest = gui.VideoPlayer( video="https://prod-streaming-video-msn-com.akamaized.net/ba258271-89c7-47bc-9742-bcae67c23202/f7ff4fe4-1346-47bb-9466-3f4662c1ac3a.mp4",

poster='',

        autoplay=True,
        loop=True,
        type='video/mp4',
        style='left: 0%; top: 0%; width: 100%; height: 90%')

====================================================== That way, OK.

Antonio0307 commented 2 years ago

I've taken care of it.................................................:)

dddomodossola commented 2 years ago

Hello @Antonio0307 ,

Of course you can play local video files. Be careful about:

Example:

import remi.gui as gui
from remi import start, App

class MyApp(App):
    def __init__(self, *args):
        #here I define my resource path
        res_path = "C:/myfolder/"
        super(MyApp, self).__init__(*args, static_file_path={'myres':res_path})
    def main(self):
        main_container = gui.VBox(width=300, height=200, style={'margin': '0px auto'})

        #please look at the video file name, it starts with "/myres:" which is the folder identification
        video = gui.VideoPlayer("/myres:video.mp4", autoplay=True, loop=True, width="100%")
        main_container.append(video)

        return main_container

if __name__ == "__main__":
    start(MyApp, address='0.0.0.0', port=0, start_browser=True, username=None, password=None)

Kind Regards

Antonio0307 commented 2 years ago

Hello @Antonio0307 ,

Of course you can play local video files. Be careful about:

Example:

import remi.gui as gui
from remi import start, App

class MyApp(App):
    def __init__(self, *args):
        #here I define my resource path
        res_path = "C:/myfolder/"
        super(MyApp, self).__init__(*args, static_file_path={'myres':res_path})
    def main(self):
        main_container = gui.VBox(width=300, height=200, style={'margin': '0px auto'})

        #please look at the video file name, it starts with "/myres:" which is the folder identification
        video = gui.VideoPlayer("/myres:video.mp4", autoplay=True, loop=True, width="100%")
        main_container.append(video)

        return main_container

if __name__ == "__main__":
    start(MyApp, address='0.0.0.0', port=0, start_browser=True, username=None, password=None)

Kind Regards

Thank you for your reply!:)