I've tried many things I've read in the forums but nothing works
I got multiple errors.
How can I play a video with vb script?
I'm using simple menu plugin and I want to play a video depending of the choosen option.
Any way??
Thanks
Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support
Sub PlaySoundWin7(SoundFile, NumRepeat, ChannelNumber)
If ChannelNumber < 9 Then
'With VBScript it is currently not possible to interact with the 8 first audio channels.
MsgBox "The specified audio channel is invalid.", vbCritical, "Error"
Exit Sub
End If
If Action.IsComponentInstalled("NSPlay.NSPlayCtl.1") = False Then
MsgBox "Unable to find the media player component.", vbCritical, "Error"
Else
If Action.DoesComponentExist("MediaPlayer" + CStr(ChannelNumber)) = false Then
AddComponent "NSPlay.NSPlayCtl.1", "MediaPlayer" + CStr(ChannelNumber)
End If
Component("MediaPlayer" + CStr(ChannelNumber)).Object.FileName = SoundFile
Component("MediaPlayer" + CStr(ChannelNumber)).Object.PlayCount = NumRepeat
Component("MediaPlayer" + CStr(ChannelNumber)).Object.Play
End If
End Sub
Sub StopSoundWin7()
Component("MediaPlayer1").Object.Stop
End Sub
Sub PlayVideoWin7(VideoFile, NumRepeat, ChannelNumber)
If ChannelNumber < 9 Then
'With VBScript it is currently not possible to interact with the 8 first video channels.
MsgBox "The specified video channel is invalid.", vbCritical, "Error"
Exit Sub
End If
If Action.IsComponentInstalled("NSPlay.NSPlayCtl.1") = False Then
MsgBox "Unable to find the media player component.", vbCritical, "Error"
Else
If Action.DoesComponentExist("MediaPlayer" + CStr(ChannelNumber)) = false Then
AddComponent "NSPlay.NSPlayCtl.1", "MediaPlayer" + CStr(ChannelNumber)
End If
Component("MediaPlayer" + CStr(ChannelNumber)).Object.FileName = VideoFile
Component("MediaPlayer" + CStr(ChannelNumber)).Object.PlayCount = NumRepeat
Component("MediaPlayer" + CStr(ChannelNumber)).Object.Play
End If
End Sub
Sub StopVideoWin7(ChannelNumber)
If ChannelNumber < 9 Then
'With VBScript it is currently not possible to interact with the 8 first video channels.
MsgBox "The specified audio channel is invalid.", vbCritical, "Error"
Exit Sub
End If
If Action.DoesComponentExist("MediaPlayer" + CStr(ChannelNumber)) = true Then
Component("MediaPlayer" + CStr(ChannelNumber)).Object.Stop
End If
End Sub
The problem is that when I click with right button of the mouse it displays a mediaplayer menu and it doesn't like me.
When a video is playing by "play a video" in the properties of a frame or in the properties of a hotspot, it doesn't happen.
reneuend wrote:When you right-click during game play??? Is that with the script or using AM's tools to set up the video?
I'll need exact details on how you are setting it up to know what the issue is. I've not had any problems with videos and Windows 7 unless I was trying something a bit unique.
Return to Adventure Maker Technical Support and Bug Reports
Users browsing this forum: No registered users and 0 guests