Page 1 of 1

Videolan ActiveX and Borland Delphi

Posted: 10 Nov 2005 11:45
by frankmarcus25
It seems to me that the Borland Problem isn't solved yet.

I have tried the latest nighty build
vlc-0.8.5-svn-20051110-0001-win32
in common with Delphi 4, Delphi 6 and Delphi 7.

It doesn't work and crashes!

When i do not place the activex component but
create it in the code (Tested with Delphi 6):


Var
VLCPlugin : TVLCPlugin;

procedure TForm1.Button1Click(Sender: TObject);
begin
VLCPlugin :=TVLCPlugin.Create(Form1);
VLCPlugin.Parent := Form1;
end;


then it crashes in the moment of setting the parent!
Debugging it shows me following:


It crashes while setting then origin with OnPosRectChange (System unit OleCtrls):


function TOleControl.OnPosRectChange(const rcPosRect: TRect): HResult;
begin
FOleInPlaceObject.SetObjectRects(rcPosRect, Rect(0, 0, 32767, 32767));
Result := S_OK;
end;


Is there anybody out there who can solve the problem?
I think that there are a lot of Delphi users waiting on it.

Frank

Posted: 10 Nov 2005 17:43
by Guest
take a look at this topic, not activex but a workaround

viewtopic.php?t=13395

VLC ActiveX in Delphi

Posted: 11 Nov 2005 12:15
by Jessi
I had the same problems yesterday.

Im trying to playback M4P (ACC DRM files from Itunes) in Delphi.
VLC is the only open source player supporting this, so I really DEPEND on it.

The ActiveX translates into a typelibrary without any problems. I can also compile/install it.

When I drop the component on my form I get "Invalid Pointer."

Creating the VLC object at runtime results in an access violation after the object is created (as outlined by frankmarkus).


There has to be some other work around for this issue. I can't start a second media player and control it using window messages just to play M4P files.

Come on guys, someone must have done that before!! How does it work? (Im also using Delphi 7 on winXP)

Cheers!
-jessi

Posted: 11 Nov 2005 12:32
by DOOM
Hello,

i cant help you with yout activex problems, seems that the runtimes dont work with delphi.

But if you only wants to playback some files:

Code: Select all

uses shellapi var VLCPATH:String; TESTFILE:String; begin VLCPATH:=('C:\tools\videolan\vlc.exe'); TESTFILE:=('-vvv c:\test.m4p'); ShellExecute(0,'open',PChar(VLCPATH),PChar(TESTFILE),nil,SW_SHOW); end;
DOOM

Posted: 14 Nov 2005 11:16
by frankmarcus25
Why there is existing an activex when it is not usable.

Come on folks! Please help the delphi community!

Contact me if there is a need for a test program!

Posted: 14 Nov 2005 12:13
by Guest
There is a workaround I used in delphi.

Use the webbrowser component, and load in it a local page html with the VLC loaded and controlled using Javascript.

You can generate the HTML dinamically to control what to do (title, play, stop,...) or use the Javascript interface through the webbrowser.

Although this is slower than embedding VLC directly it works rather well, and is robust.

Regards,


Jose

Posted: 14 Nov 2005 17:18
by Quovodis
I've modified the ActiveX control so that it works better with Delphi, please note that Delphi ActiveX support is pretty bad so don't expect miracles (I tested using Dephi 2005). Most of the changes I have made are done to get around bugs in Delphi.

Unfortunately, VLC doesn't resize properly in a Form, and there is nothing I can do about it !

anyway, the fix will be available in the next nightly builds (both 0.8.4 and 0.8.5 svn)

enjoy

VLC ActiveX in Delphi

Posted: 15 Nov 2005 00:33
by Jessi
..and there it is! Works perfect for me!!

Great job - thanks for you help!

Posted: 15 Nov 2005 21:08
by frankmarcus25
Thanks for your help!!!!

Frank

Posted: 21 Nov 2005 16:06
by dumarjo
work great in delphi 7

I will try it under c++ builder 6 this week

Jonathan

Posted: 21 Nov 2005 17:45
by frankmarcus25
Sometimes the activex is very instabile and crashes if the computer's
utilization is near 100%. Anybody has an idea why?

Frank

Re: Videolan ActiveX and Borland Delphi

Posted: 16 Apr 2008 07:23
by Themasteratdelphi
yes indeed VLC does work in delphi. If your having problems its not installed properly.

the resize thing is a pain but it can be done manually, ie typing the numbers into top, left, width and height. Also you cannot click the player to select it you must click the name of the player within the object tree view to do this.

i suppose this is something to do with the whole delphi environment and the fact that when clicked or dragged the program for the activex must decide whether it is in design mode or run mode. This is accomplished with

Code: Select all

if csdesigning in componentstate then...
within the corresponding events.

Componentstate is declared as a set within the Tcomponent class.

Re: Videolan ActiveX and Borland Delphi

Posted: 16 Apr 2008 07:27
by Themasteratdelphi
also with the whole 100% thingy...

ive never had this happen but i suspect the ActiveX has not crashed but is processing data. Becuase your processor utilisation is at 100% the activeX has no more time to process itself than it already has, this causes your program to hang. And may look like a crash, if nothing is being displayed / events (messages) are not processed etc. The solution is to 1. get a new computer / porecessor 2. play things that dont make the program crash or 3. be patient.

sorry i cant help anymore