Autor Beitrag
Jana
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18

Win XP, Win Vista
Delphi 2005, Visual Basic .Net
BeitragVerfasst: Di 16.01.07 18:47 
Ich habe jetzt auch einmal probiert etwas mit TMediaPlayer zu basteln, aber wenn ich dann auf Button1 klicke kommt nur der Fehler: Project Project1.exe raised exception class EMCIDeviceError with message 'No MCI device open'. Process stopped. Use Step or Run to continue.

Was kann ich dagegen machen? Mein Code sieht bisher nur so aus:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, MPlayer, MMSystem;

type
  TForm1 = class(TForm)
    MediaPlayer1: TMediaPlayer;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  MediaPlayer1.Play;
end;

end.
DBR
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 46



BeitragVerfasst: Do 25.01.07 14:37 
Vorausgesetzt, du hast schon eine Datei in den Player geladen:

ausblenden Delphi-Quelltext
1:
2:
 MediaPlayer1.open;
 MediaPlayer1.Play;
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Do 25.01.07 14:44 
Hallo Jana!

Vorrausgesetzt du hast dem Mediaplayer auch eine Dateinamen angeben, also die Datei, die abgespielt werden soll.

Dies kannst du entweder im Objektinspektor tun, oder aber um ihn per Laufzeit zuzuweisen im Quelltext.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
 ...
 mediaplayer.filename:= 'DerDateiname';
 mediaplayer.open;
 mediaplayer.play; //oder halt nicht :)
 ...


LG
Stefan

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
Jana Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18

Win XP, Win Vista
Delphi 2005, Visual Basic .Net
BeitragVerfasst: Sa 27.01.07 13:55 
Danke für die Hilfe. Das Program funktioniert jetzt.