Videolan ActiveX and Borland Delphi

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
frankmarcus25
New Cone
New Cone
Posts: 4
Joined: 10 Nov 2005 11:28

Videolan ActiveX and Borland Delphi

Postby frankmarcus25 » 10 Nov 2005 11:45

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

Guest

Postby Guest » 10 Nov 2005 17:43

take a look at this topic, not activex but a workaround

viewtopic.php?t=13395

Jessi

VLC ActiveX in Delphi

Postby Jessi » 11 Nov 2005 12:15

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

DOOM
Blank Cone
Blank Cone
Posts: 29
Joined: 24 Oct 2005 09:55

Postby DOOM » 11 Nov 2005 12:32

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

frankmarcus25
New Cone
New Cone
Posts: 4
Joined: 10 Nov 2005 11:28

Postby frankmarcus25 » 14 Nov 2005 11:16

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!

Guest

Postby Guest » 14 Nov 2005 12:13

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

Quovodis
Cone that earned his stripes
Cone that earned his stripes
Posts: 271
Joined: 16 Jun 2004 11:13
Location: Cork, Ireland

Postby Quovodis » 14 Nov 2005 17:18

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

Jessi

VLC ActiveX in Delphi

Postby Jessi » 15 Nov 2005 00:33

..and there it is! Works perfect for me!!

Great job - thanks for you help!

frankmarcus25
New Cone
New Cone
Posts: 4
Joined: 10 Nov 2005 11:28

Postby frankmarcus25 » 15 Nov 2005 21:08

Thanks for your help!!!!

Frank

dumarjo
Blank Cone
Blank Cone
Posts: 29
Joined: 04 Dec 2003 21:03

Postby dumarjo » 21 Nov 2005 16:06

work great in delphi 7

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

Jonathan

frankmarcus25
New Cone
New Cone
Posts: 4
Joined: 10 Nov 2005 11:28

Postby frankmarcus25 » 21 Nov 2005 17:45

Sometimes the activex is very instabile and crashes if the computer's
utilization is near 100%. Anybody has an idea why?

Frank

Themasteratdelphi
New Cone
New Cone
Posts: 6
Joined: 16 Apr 2008 06:11

Re: Videolan ActiveX and Borland Delphi

Postby Themasteratdelphi » 16 Apr 2008 07:23

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.

Themasteratdelphi
New Cone
New Cone
Posts: 6
Joined: 16 Apr 2008 06:11

Re: Videolan ActiveX and Borland Delphi

Postby Themasteratdelphi » 16 Apr 2008 07:27

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


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 2 guests