Skip to main content

Command Palette

Search for a command to run...

BrightScript code example roVideoPlayer

Updated
1 min read

This example shows how to play a video loop and send out UDP message at the end of the video.


' This sample code loops a video and send out a UDP message at the end of the video.
' Created by BrightScripters

' Usage
' Place this script at the root of a blank microSD card.
' Typically this file would be renamed to autorun.brs so it starts automatically.
' Place a video file at the root of the microSD card. The script will look for file name video1.mp4.
' Every time the video file reaches its end, a UDP message is sent out and the video restarts.
' Make adjustments to the variables bellow.

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Variables
videoFileName$ = "video1.mp4"
udpMessage$ = "my_udp_message"
udpPort% = 5000
udpDestinationIp$ = "255.255.255.255"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''

u = createObject("roDatagramSender")
u.setDestination( udpDestinationIp$, udpPort% )

v = createObject("roVideoPlayer")

Find the rest of this code at
https://buymeacoffee.com/brightscripters/brightscript-code-example-rovideoplayer