Closed Antonio0307 closed 2 years ago
I've taken care of it.................................................:)
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
Hello @Antonio0307 ,
Of course you can play local video files. Be careful about:
- supported file formats = Video widget supports the html5 file formats. Please look at this:https://stackoverflow.com/questions/5959833/what-are-all-the-formats-of-video-supported-by-html5
- resource path = for local files you should respect the remi resource filenames.
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!:)
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='',
====================================================== That way, OK.