Re: Playing Video in a Dialog
On 17/04/14 11:23, Fernand Vanrie wrote: On The French user site i found usefull code to play video on Windows using the API and Basic. The code opens a MediaWindow and play any video The player has a undocumented method CreatePlayerWindow who needs arguments (a empty array do crash LO) Do someone knows how to use this method and how Video can been played in a Dialog ? hi Fernand, let's see... avmedia/source/win/window.cxx: bool Window::create( const uno::Sequence uno::Any rArguments ) { IVideoWindow* pVideoWindow = const_cast IVideoWindow* ( mrPlayer.getVideoWindow() ); WNDCLASS* mpWndClass = lcl_getWndClass(); if( !mnFrameWnd pVideoWindow mpWndClass ) { awt::Rectangle aRect; sal_IntPtr nWnd; rArguments[ 0 ] = nWnd; rArguments[ 1 ] = aRect; mnParentWnd = static_castint(nWnd); so on Windows, parameters are a HWND of the parent and a rectangle... probably the parameters are undocumented for a reason, very system-dependent and subject to change without notice. also i have no idea how you can get a window's HWND from BASIC code. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Playing Video in a Dialog
On 28/04/2014 18:07, Michael Stahl wrote: On 17/04/14 11:23, Fernand Vanrie wrote: On The French user site i found usefull code to play video on Windows using the API and Basic. The code opens a MediaWindow and play any video The player has a undocumented method CreatePlayerWindow who needs arguments (a empty array do crash LO) Do someone knows how to use this method and how Video can been played in a Dialog ? hi Fernand, let's see... avmedia/source/win/window.cxx: bool Window::create( const uno::Sequence uno::Any rArguments ) { IVideoWindow* pVideoWindow = const_cast IVideoWindow* ( mrPlayer.getVideoWindow() ); WNDCLASS* mpWndClass = lcl_getWndClass(); if( !mnFrameWnd pVideoWindow mpWndClass ) { awt::Rectangle aRect; sal_IntPtr nWnd; rArguments[ 0 ] = nWnd; rArguments[ 1 ] = aRect; mnParentWnd = static_castint(nWnd); so on Windows, parameters are a HWND of the parent and a rectangle... probably the parameters are undocumented for a reason, very system-dependent and subject to change without notice. also i have no idea how you can get a window's HWND from BASIC code. Michael thakns for the hint on the ooForum i found this code: Dim arg(0) As Object Dim oWindow As Object ... moSM = CreateObject(com.sun.star.ServiceManager) moDesk = moSM2.CreateInstance(com.sun.star.frame.Desktop) oWindow = moDesk.ActiveFrame.GetContainerWindow() Dim tableau() tableau = Array() ' the 1st param is an empty array, the 2nd is an integer = 1 (may be OS dependant ?) mHwndOOo = oWindow.getWindowHandle(tableau, 1) but how to make this work in a dialog ? Greetz Fernand ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Playing Video in a Dialog
On The French user site i found usefull code to play video on Windows using the API and Basic. The code opens a MediaWindow and play any video The player has a undocumented method CreatePlayerWindow who needs arguments (a empty array do crash LO) Do someone knows how to use this method and how Video can been played in a Dialog ? Thanks for any hints Global video Global oPlayer Global Player_flag, Video_flag, Time ' -- Sub VideoPlayer If Video_flag = 0 Then video =converttoURL(C:\Users\PMG\Videos\Untitled.avi) ' La vidéo à charger Video_flag = 1 'for windows: oManager = CreateUnoService(com.sun.star.media.Manager_DirectX) ' for Linux ' oManager = CreateUnoService(com.sun.star.media.Manager_GStreamer) End Select oPlayer = oManager.createPlayer( video ) ' oPlayer.CreatePlayerwindow(array()) ' do crash LO oPlayer.start() ' Lecture Player_flag = 1 Else oPlayer.start() ' Lecture Player_flag = 1 End If End Sub ' -- Sub VideoPlayer_pause If Player_flag = 1 Then oPlayer.stop() ' Pause Player_flag = 0 Time = oPlayer.getmediatime() End If End Sub ' -- Sub VideoPlayer_avance_rapide If Player_flag = 0 Then oPlayer.setmediatime(Time +1) ' Avance_rapide Time = oPlayer.getmediatime() End If End Sub ' -- Sub VideoPlayer_recul_rapide If Player_flag = 0 Then oPlayer.setmediatime(Time -1) ' Recul_rapide Time = oPlayer.getmediatime() End If End Sub ' -- Sub VideoPlayer_stop oPlayer.stop() ' Pause 'Video_flag = 1 Time = 0 oPlayer.setmediatime(Time) End Sub ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [libreoffice-users] Playing Video in a Dialog
Hi :) I am guessing that you have already posted to the devs mailing list or irc channel? Also to the French mailing list? If not then it's worth trying. It seems a bit weird they have gone for a proprietary, undocumented player instead of gnash, swfplayer, totem, Vlc or some other OpenSource alternative. There probably is a reason. If it's purely down to trying to use something that you can be certain people already have on their system then Vlc might be worth a try because that is quite popular too. (plus you can always give a link for people to downnload and install an OpenSource alternative anyway (as people do for pdfs)) Regards from Tom :) On 17 April 2014 10:23, Fernand Vanrie s...@pmgroup.be wrote: On The French user site i found usefull code to play video on Windows using the API and Basic. The code opens a MediaWindow and play any video The player has a undocumented method CreatePlayerWindow who needs arguments (a empty array do crash LO) Do someone knows how to use this method and how Video can been played in a Dialog ? Thanks for any hints Global video Global oPlayer Global Player_flag, Video_flag, Time ' -- Sub VideoPlayer If Video_flag = 0 Then video =converttoURL(C:\Users\PMG\Videos\Untitled.avi) ' La vidéo à charger Video_flag = 1 'for windows: oManager = CreateUnoService(com.sun.star.media.Manager_DirectX) ' for Linux ' oManager = CreateUnoService(com.sun. star.media.Manager_GStreamer) End Select oPlayer = oManager.createPlayer( video ) ' oPlayer.CreatePlayerwindow(array()) ' do crash LO oPlayer.start() ' Lecture Player_flag = 1 Else oPlayer.start() ' Lecture Player_flag = 1 End If End Sub ' -- Sub VideoPlayer_pause If Player_flag = 1 Then oPlayer.stop() ' Pause Player_flag = 0 Time = oPlayer.getmediatime() End If End Sub ' -- Sub VideoPlayer_avance_rapide If Player_flag = 0 Then oPlayer.setmediatime(Time +1) ' Avance_rapide Time = oPlayer.getmediatime() End If End Sub ' -- Sub VideoPlayer_recul_rapide If Player_flag = 0 Then oPlayer.setmediatime(Time -1) ' Recul_rapide Time = oPlayer.getmediatime() End If End Sub ' -- Sub VideoPlayer_stop oPlayer.stop() ' Pause 'Video_flag = 1 Time = 0 oPlayer.setmediatime(Time) End Sub -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to- unsubscribe/ Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette List archive: http://listarchives.libreoffice.org/global/users/ All messages sent to this list will be publicly archived and cannot be deleted ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice