Войти

Показать полную графическую версию : mciSendString из скрипта


pva
06-11-2008, 15:45
как можно запустить функцию mciSendString из скрипта jscript или vbscript? так чтобы не писать свои программные приблуды. Вот это надо:

mciSendString("play sample.wmv wait fullscreen", 0, 0, 0);

Delirium
07-11-2008, 03:12
Почему то я сомневаюсь, что простым способом это будет возможно.
The mciSendString function sends a command string to an MCI device. The device that the command is sent to is specified in the command string.

MCIERROR mciSendString(
LPCTSTR lpszCommand,
LPTSTR lpszReturnString,
UINT cchReturn,
HANDLE hwndCallback
);
Parameters

lpszCommand

Pointer to a null-terminated string that specifies an MCI command string. For a list, see Multimedia Command Strings.

lpszReturnString

Pointer to a buffer that receives return information. If no return information is needed, this parameter can be NULL.

cchReturn

Size, in characters, of the return buffer specified by the lpszReturnString parameter.

hwndCallback

Handle to a callback window if the "notify" flag was specified in the command string.

Return Values

Returns zero if successful or an error otherwise. The low-order word of the returned DWORD value contains the error return value. If the error is device-specific, the high-order word of the return value is the driver identifier; otherwise, the high-order word is zero. For a list of possible error values, see MCIERR Return Values.

To retrieve a text description of mciSendString return values, pass the return value to the mciGetErrorString function.

Requirements

Windows NT/2000/XP: Included in Windows NT 3.1 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Mmsystem.h; include Windows.h.
Library: Use Winmm.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT/2000/XP.

Библиотеку вряд ли удастся подключить. Хотя может я и ошибаюсь.

pva
07-11-2008, 07:29
Ну rundll тоже библиотека, которую надо подключать, однако ведь есть способ вызвать у ней некоторые функции (shutdown например) Может тут тоже как-то можно? Нужно, короче, проиграть видеоролик без посторонних эффектов типа мелькания на экране проигрывателя

Delirium
07-11-2008, 07:42
А видеоролик должен запускаться автоматически или же по нажатию кнопки, примерно как на youtube ?

Может быть это поможет:
inserting video from JavaScript (http://www.c-point.com/javascript_tutorial/Editor/inserting_video.htm)
http://www.c-point.com/javascript_tutorial/MMTutorial/lMusic.htm
http://www.dotnetcurry.com/ShowArticle.aspx?ID=177&AspxAutoDetectCookieSupport=1

amel27
07-11-2008, 07:58
pva
как можно запустить функцию mciSendString из скрипта
AFAIK WSH не работает с API, только с COM, как вариант - AutoIT или AutoHotKey

Delirium
07-11-2008, 08:55
AFAIK WSH не работает с API, »
речь идет о java скрипте, не о wsh/vbs.

amel27
07-11-2008, 09:10
о java скрипте, не о wsh/vbs »
движок один, http://support.microsoft.com/kb/188135
WSH is a language-independent scripting host for 32-bit Windows platforms. Microsoft provides both Microsoft Visual Basic Script and Java Script scripting engines with WSH

pva
07-11-2008, 09:14
http://www.mioplanet.com/rsc/embed_mediaplayer.htm вот ещё ссылку нашёл. Одна проблема: некоторые ролики не играет, точнее играет, но без картинки, хотя если запустить их медиаплеером, то картинка есть.

Delirium
07-11-2008, 09:32
вот ещё ссылку нашёл »
я именно таким методом как то внедрял видео и тоже были проблемы с просмотром. Источник причины выявить не удалось.
amel27, познавательно, а я и не знал :)

pva
07-11-2008, 13:23
а есть какое-нить событие, что ролик закончился? ну типа onfinish="alert('done/1')"




© OSzone.net 2001-2012