Presentation of film clips (part II)
Jan Seifert
seif1301 at uni-trier.de
Wed Feb 6 14:28:37 UTC 2002
Dear E-Prime users
We need to play digital video clips for one of our upcoming experiments. According to a message of this EPrime discussion list, there is no possibility to do that with
EPrime itself. Nonetheless we tried to get around with this problem. For this part of the experiment, a precise timing in millisecond range is not that important for us. So
we thought it to be possible, that we play films via MCI or Windows Media Player. I’ll send our two code examples along with this message, that you can see, what we
have done. The code works well up to the end of the presentation. In both cases we get an error message then, which none of us exactly understands:
"Internal Error: Drawing Error 0x887601c2"
First we thought, the problems are due to the "E-Prime Experiment Window" losing the focus. But a "WinActivate"-command after presentation doesn’t prove any
success.
Maybe there is someone out there, who can help us out? Any help would be greatly appreciated.
Thanks awfully...
Jan Seifert
'******** Filmclips via MCI ***********************************************
'**** User Section
Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As
String, ByVal lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Declare Function mciGetErrorString Lib "winmm.dll" Alias "mciGetErrorStringA" (ByVal
fdwError As Long, ByVal lpszErrorText As String, ByVal cchErrorText As Long) As Long
'**** Inline Movie via mci ****
Dim R&, AA$, L&, ReturnStr$
Dim VideoHandle, ERunHandle
R = mciSendString("open mall.mov alias mall style 4", 0&, 0, 0&)
If (R <> 0) Then
AA = Space(128)
L = mciGetErrorString(R, AA, 100)
MsgBox AA & ": " & R
End If
R = mciSendString("play mall fullscreen", 0&, 0, 0&)
If (R <> 0) Then
AA = Space(128)
L = mciGetErrorString(R, AA, 100)
MsgBox AA & ": " & R
End If
Sleep (7000)
R = mciSendString("close mall", 0&, 0, 0&)
If (R <> 0) Then
AA = Space(128)
L = mciGetErrorString(R, AA, 100)
MsgBox AA & ": " & R
End If
'*** Filmclips via MediaPlayer ****************************************************
'*** User Section ****
Declare Function OpenProcess Lib "Kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Declare Function GetExitCodeProcess Lib "Kernel32" (ByVal hProcess As Long, lpExitCode As Long) As Long
Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
Const STILL_ACTIVE = &H103
Const PROCESS_QUERY_INFORMATION = &H400
Sub Shell32Bit(ByVal JobToDo As String) '*********************
Dim Dummy As Long
Dim hProcess As Long
Dim RetVal As Long
'The next line launches JobToDo as icon,
'captures process ID
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, Shell(JobToDo, ebMaximizedFocus)) ',
Do
'Get the status of the process
Dummy = GetExitCodeProcess(hProcess, RetVal)
'Sleep command recommended as well as DoEvents
DoEvents: Sleep 100
'Loop while the process is active
Loop While RetVal = STILL_ACTIVE
' get the focus back; but that doesn’t help
WinActivate("E-Run Experiment Window")
End Sub
**** Inline MediaPlayer ****
Shell32Bit("mplayer2.exe /fullscreen /play /close mall.mov")
/
\ Jan Seifert
\
\ Universität Trier
\ FB I - Psychologie
\ Gebäude D, Room D217
\ 54296 Trier
\
\ Phone: +49 (0)651 201-2896
\ E-Mail: seif1301 at uni-trier.de
/
More information about the Eprime
mailing list