We have a HD1025 splilted into2 zones a Left one and a Right one and having 2 videoclips (1 in each zone) which shall play when GPIO are triggered.
That works fine to play the Left and Right video when GPIO are triggered
We have analog audio out 3.5mm and want the Left channel to play audio from the left videoplayer and the Right channel to play audio from the Right video.
Please advise how to do that as brightscript.
videoFile_Loop_L = "Lights_Logo.mp4"
videoFile_Person_L = "Crashtest.mp4"
videoFile_Loop_R = "Lights_Logo.mp4"
videoFile_Person_R = "Crashtest.mp4"
mode=CreateObject("roVideoMode")
mode.SetMode("1920x1080x60p")
EnableZoneSupport(true)
EnableAudioMixer(true)
p = CreateObject("roMessagePort")
vL=CreateObject("roVideoPlayer")
vL.SetViewMode(0) ' loop off=0 loop on=1
l=CreateObject("roRectangle", 0, 0, 960, 1080)
vL.SetRectangle(l)
vL.SetPort(p)
vL.SetUserData("Left")
vL.SetAudioOutput(0)
vR=CreateObject("roVideoPlayer")
vR.SetViewMode(0) ' loop off=0 loop on=1
r=CreateObject("roRectangle", 960, 0, 960, 1080)
vR.SetRectangle(r)
vR.SetPort(p)
VR.SetUserData("Right")
vR.SetAudioOutput(0)
gpio = CreateObject("roGpioControlPort")
gpio.SetPort(p)
gpio.EnableInput(0)
gpio.EnableInput(1)
vL.PlayFile(videoFile_Loop_L)
vR.PlayFile(videoFile_Loop_R)
Print "Main loop"
main_loop:
msg = wait(0,p)
print "msg_a: ";msg
print "type: ";type(msg)
'-------------check for GPIO---------
if gpio.IsInputActive(0) Then
print "Gpio 0"
vL.StopClear()
vL.PlayFile(videoFile_Person_L)
endif
if gpio.IsInputActive(1) Then
print "Gpio 1"
vR.StopClear()
vR.PlayFile(videoFile_Person_R)
endif
'-------------end video----------
if type(msg) = "roVideoEvent" then
if msg.GetInt() = 8 then
' sourceID = msg.GetSourceIdentity()
sourceID = msg.GetUserData()
print sourceID
if sourceID = "Left"
vL.PlayFile(videoFile_Loop_L)
print "Video L finished playing"
else if sourceID = "Right"
vR.PlayFile(videoFile_Loop_R)
print "Video R finished playing"
endif
print "End_Of_File"
endif
endif
'----------end messageport-----------
GoTo main_loop