FAQ
Q: I cannot play WMV files. Either I get a program crash with an exception screen or the files plays with garbage in the window. I do not have this problem with AVi or MPG
movies.
A: Download this
package from the Microsoft web site and install it to get rid of this
problem.
Q: When I compile and run my project, the playback fails or freezes as
still pictures. But when I run the .exe out of the IDE, everything works
just fine.
A: This sounds like the codec required to play the video clip detects the
Delphi or C++Builder debugger, and switches in debug mode, or has some protection against debugging.
When the the project is ran out of the IDE, the codec is not under the debugger
control and the clips plays normally.
In this case the problem is "third-party located" (in the codec), so the only workaround consists to run the project out of the IDE.
Another workaround consists to make tests with a video clip that requires another
codec that is not debugger-dependent.
This problem has been reported with TActiveMovie when playing VOB
video clips and the InterVideo WinDVD player is installed on the platform.
A workaround consists to install another MPEG2 decoder, e.g. like the Elecard
MPEG2 decoder.
Q: When running my project including TActiveMovie, I get directly
an access violation and nothing is displayed. The same problem occurs when
running the MainDemo.exe included in the TActiveMovie package.
A: This problem has been reported on a platform having a
wrong MSDXM.OCX file. We suggest you to compare this file on the machine that
fails, with the same MSDXM.OCX file on a similar platform (same operating
system) that works. If the file dates and times are different, copy the MSDXM.OCX
from the machine that works to the machine that fails, and re-register it by
invoking e.g. "regsvr32 c:\windows\system32\msdxm.ocx".
Q: When opening a video clip, I
get a black window and I get an access violation. The clip never opens.
A: This problem has been reported with video clips having AC3-encoded
audio. The fix consists to install this
free AC3 codec, compatible with TActiveMovie.
Q: Is the Microsoft's Windows Media Player installed by default on all
32 bits Windows platforms?
A: The Windows Media Player v6.4 or higher is installed by default
starting from Windows 98 Second Edition.
For Windows 95 and Windows 98 1st Edition, it can be freely downloaded and
installed from the Microsoft's
web site.
Q: I loaded up the demo for
TActiveMovie in Delphi 6 Trial and
tried to build it.
I am getting the following error: Access violation at address 009807e7 in
module dcc60.dll read of address 000E9c6.
A: The trial version
comes with a different DCU format than the real one.
You
can't use it or other third party components in the trial.
Q: I am using Delphi4. When
starting a video from the IDE, sometimes Delphi reports thread errors.
A:
Apply the Update Packs #2 and #3 (the #3
solves the problem, the #2 is required by the #3). They can be downloaded at http://www.borland.com/devsupport/delphi/downloads/index.html.
If the problem persists,
run your project out of the IDE.
Q: When I run my project
from C++Builder, I get a 'CoInitialize
has not been called'
error.
A: Add a CoInitialize(NULL) statement in
your main Form's OnCreate event and a CoUninitialise() statement in your main
Form's OnDestroy event.
Q: I installed the Component as instructed, however when
compile the demo, I receive the following error: "Unable to locate
AmovCtl.pas".
A: It is a problem of search path: Delphi or C++ Builder cannot find the
AMovCtl.dcu file,
because the package has been installed in a directory that is not included in the Delphi
or C++Builder search path.
In Tools | Environment Options | Library | Library
path, you should have the TActiveMovie's component installation path declared. So, if you installed TActiveMovie in the Import directory,
check in Delphi or C++Builder if this path
exists ($(BCB)\Imports or $(DELPHI)\Imports).
If you installed TActiveMovie in another directory, you
must add it either to the global search path above, either in your project's search
path, in Project | Options | Directories/Conditional | Search Path.
Q: I get an error when
opening mpeg clips. Nothing is displayed.
A: 2 possibilities:
1. the codec required by your
clip is not installed on your platform. To check that, try to open the clip with
the Windows Media Player.
- if the media player reports an error, try to find and install the required
codec.
- if the media player downloads and install automatically the codec, and then,
plays the clip, try again to open the clip with TActiveMovie.
2. errors when opening
clips are often caused
by bugs in third-party codecs. Try to open the clip in the
Windows Media Player. If the clip don't work in the WMP as well, and you have
additional(s) codec(s) installed, remove it(them) and try again.
HOW TO
Automatically
play the next movie as soon as the previous ends
There are several ways to do that. The
following code works fine:
- create the OpenNewStream procedure as follow,
- call OpenNewStream to play the first clip,
- in the ActiveMovie's OnEndOfStream event, call OpenNewStream with the next
clip to play as showed below.
procedure TForm1.OpenNewStream (MediaFile: string);
begin
if (ActiveMovie1.OpenState <> nsClosed) then begin
ActiveMovie1.Close;
end;
ActiveMovie1.AutoStart := True;
ActiveMovie1.FileName := MediaFile;
ActiveMovie1.OpenSync;
end;
procedure TForm1.ActiveMovie1EndOfStream(Sender: TObject; Result: Integer);
var
MediaFile: WideString;
begin
// replace the line below by your next clip selection
MediaFile := 'NextClip.mpeg';
OpenNewStream (MediaFile);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
MediaFile: WideString;
begin
// replace the line below by your first clip selection
MediaFile := 'FirstClip.mpeg';
OpenNewStream (MediaFile);
end;
play mp3 files without visible player
- the first trick is to use a non-visible form...
but the form must be visible for the player to play!
- so, the second trick is to put the form out of the screen with a
"zero" size:
procedure TForm1.Button1Click(Sender: TObject);
var
NonVisibleParent: TForm;
ActiveMovie: TActiveMovie;
begin
NonVisibleParent := TForm.Create (Self);
NonVisibleParent.SetBounds (- 100, - 100, 0, 0);
NonVisibleParent.Visible := True;
ActiveMovie := TActiveMovie.Create (NonVisibleParent);
ActiveMovie.Parent := NonVisibleParent;
ActiveMovie.FileName := 'yourfile.mp3';
ActiveMovie.OpenSync;
ActiveMovie.Play;
end;
KNOWN ISSUES
Interactions between TWebBrowser and TActiveMovie
If you are using a TWebBrowser and TActiveMovie components within
the same application, be sure to create the TActiveMovie component before
opening a web page in TWebBrowser, and do not destroy or recreate the
TActiveMovie component after opening a web page, otherwise you will get
unpredictable results.
If you need to switch TActiveMovie from a visible to a non-visible
state, enable / disable the "Visible" property rather than destroying
/ recreating the component.
After playing by using SelectionStart and SelectionEnd a first
time, changing values later plays from erroneous positions.
This is a bug of the current version. The workaround consists to reset both
positions before setting them:
ActiveMovie1.SelectionStart := -1; // resets start position
ActiveMovie1.SelectionEnd := -1; // resets end position
ActiveMovie1.SelectionStart : = 10; // sets the new start
position
ActiveMovie1.SelectionEnd : = 15; // sets the new end position
Access violation "Read of address FFFFFFFF" on exit when
the ShowStatusBar property is enabled from the Object Inspector
This is a bug of the current version. Tje workaround consists to , enable the ShowStatusBar
programmatically at runtime:
- let the ShowStatusBar property disabled in the Object Inspector,
add the following statement in the OnCreate event of your TActiveMovie's
form:
ActiveMovie1.ShowStatusBar := true;