Page 1 of 1

PlayVideo routine not working

PostPosted: Tue Jan 18, 2011 1:43 am
by reneuend
Is this a known issue? I'm getting an error when using the PlayVideo routine with Win7 64bit.

Error: "type mismatch mediaplayer object"

Frame Properties code:
Code: Select all
Action.CreateTimedEvent 5, "PlayVideo GetPath(5) & ""buzzard.avi"", 340, 0, 300, 200, False", False



Procedure:
Code: Select all
Sub PlayVideo(FileName, Left, Top, Width, Height, Repeat)
'Full screen video: PlayVideo "c:\filename.avi", 0, 0, 640, 480, False
'If the video is located in your "Frames" folder, use the "GetPath(5)" command:
'To stop a video: StopVideo
Action.LoadControl MediaPlayerObject(1)
MediaPlayerObject(1).Move Left*ScreenObject.TwipsPerPixelX, Top*ScreenObject.TwipsPerPixelX, Width*ScreenObject.TwipsPerPixelY, Height*ScreenObject.TwipsPerPixelY
MediaPlayerObject(1).FileName = FileName
If Repeat = True Then
MediaPlayerObject(1).PlayCount = 0
Else
MediaPlayerObject(1).PlayCount = 1
End If
MediaPlayerObject(1).Visible = True
MediaPlayerObject(1).Play
End Sub

PostPosted: Tue Jan 18, 2011 6:22 am
by Mystery
Yes, as GM stated for the new AM version
Due to the change in the audio system, the "MediaPlayerObject(INDEX)" and the "AudioPlayerObject" objects are no longer accessible through VBScript.


So just as for the sound also for the videos there is another code that we have to use for W7 compatible games.
Not sure where the video code is posted though.

PostPosted: Tue Jan 18, 2011 10:22 am
by juhuwoorps
You can use the same routine as for playing sounds .

To move the video I have tried this Code:


Code: Select all
Component("MediaPlayer1").top=100*15
Component("MediaPlayer1").left=100*15
Component("MediaPlayer1").width=100*15
Component("MediaPlayer1").height=100*15


The movement of the viedeo works, but it seems that you can't change the size of the video.

PostPosted: Tue Jan 18, 2011 2:02 pm
by Mystery
Thanks juhu :)

No, stretching is not possible; see the limitations listed by GM:
Please be aware that, because of the audio/video changes related to Windows 7, it is no longer possible to:

* Set the volume of individual sounds/videos
* Fade-in, fade-out and cross-fade music and sound files
* Stretch a video to a size bigger than its original size
* Put an image on top of a looping video

PostPosted: Tue Jan 18, 2011 2:50 pm
by reneuend
Thanks for the information. I looked at the limitations but somehow I missed it. Could be too many late nights catching up with me.