PlayVideo routine not working

Everything AM users with W7 computers need to know

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

PlayVideo routine not working

Postby reneuend » Tue Jan 18, 2011 1:43 am

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
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2686
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Postby Mystery » Tue Jan 18, 2011 6:22 am

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.
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby juhuwoorps » Tue Jan 18, 2011 10:22 am

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.
juhuwoorps
Code Master
 
Posts: 622
Joined: Tue Jul 08, 2008 3:13 pm

Postby Mystery » Tue Jan 18, 2011 2:02 pm

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
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland

Postby reneuend » Tue Jan 18, 2011 2:50 pm

Thanks for the information. I looked at the limitations but somehow I missed it. Could be too many late nights catching up with me.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2686
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA


Return to Windows 7 issues

Who is online

Users browsing this forum: No registered users and 1 guest