Autor Beitrag
zangelo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 50



BeitragVerfasst: Mo 05.09.05 21:49 
Hallo
Ist es schwer einen Media Player zu coden. Es sollte nich viel können, datei öffnen, play, stop, pause.


Moderiert von user profile iconGausi: Topic aus Sonstiges verschoben am Di 06.09.2005 um 10:18
Pdd
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 142

Win XP
Delphi 7
BeitragVerfasst: Mo 05.09.05 21:50 
ne das is nich schwer. :D 8)

_________________
Wenn alles steht und nix mehr looft, denn isses was von Meikrosooft
zangelo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 50



BeitragVerfasst: Mo 05.09.05 21:56 
gut, danke dir.
so jetzt kann ich paar fragen zu stellen ;)
Muss ich das mit dem Modul MediaPlayer (MPlayer) machen?
Was muss ich als Vorschaufenster nehmen, bei Bildern hab ich z.B. immer der Webbrowser (SHDocVw) genommen.
MFG Zangelo
Pdd
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 142

Win XP
Delphi 7
BeitragVerfasst: Mo 05.09.05 22:02 
Zitat:
gut, danke dir.

bbitte schön :D
Zitat:
so jetzt kann ich paar fragen zu stellen ;)

schies los! :lol:
Zitat:
Muss ich das mit dem Modul MediaPlayer (MPlayer) machen?

du würdest es wahrscheinlich auch ohne hinbekommen, aber es ist nicht gerade sehr ratsam!
Zitat:
Was muss ich als Vorschaufenster nehmen, bei Bildern hab ich z.B. immer der Webbrowser (SHDocVw) genommen.

was meinst du mit vorschaufenster?


Pdd

_________________
Wenn alles steht und nix mehr looft, denn isses was von Meikrosooft
zangelo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 50



BeitragVerfasst: Di 06.09.05 07:07 
Mit Vorschaufenster meine ich, das Feld, in dem das Video läuft.

und wie Programmiere ich die Medialeiste?

Also wenn ich in dem Unit1.pas mal MediaPlayer1. eintippe kommen gute Sachen, wie stop;, play;, open;, stepp;.....
nur wenn ich das eintrage, und dann auf F9 drücke ist die Playerleiste nur grau, und kann nicht bediehnt werden :(.
Pdd
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 142

Win XP
Delphi 7
BeitragVerfasst: Di 06.09.05 07:30 
ach du willst MIT Video, dass wird dann etwas komplizierter. :lol:
aber mit
.filename:'';
.open;
.play;
kannste ne datei abspielen(sound)

googlem doch mal nach nem tutorial, da fidest sicher was!°!

_________________
Wenn alles steht und nix mehr looft, denn isses was von Meikrosooft
zangelo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 50



BeitragVerfasst: Di 06.09.05 07:47 
ok, dann mach ich erst ein mp3 player

also ich hab jetzt Doppelklick auf die Medialeiste gemacht.
dann hab ich das hier eingetragen:
MediaPlayer1.filename:'D:\Eigene Dateien\Eigene Musik\ACDC - Blow Up Your Video\01-heatseeker.mp3';
MediaPlayer1.open;
MediaPlayer1.play;

Jetzt klick ich auf F9 und dann makiert er mir das hier rot:
MediaPlayer1.filename:'D:\Eigene Dateien\Eigene Musik\ACDC - Blow Up Your Video\01-heatseeker.mp3';

und bleibt bei dem Doppelpunkt stehen, was is da jetzt falsch?


edit:
hab es so hinbekommen, dass es startet, und zwar so:
MediaPlayer1.filename :='D:\Eigene Dateien\Eigene Musik\ACDC - Blow Up Your Video\01-heatseeker.mp3';
MediaPlayer1.open;
MediaPlayer1.play;

nur jetzt passiert nichts, die leiste is auch noch immer inaktiv :(
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Di 06.09.05 08:04 
Trag deine Werte mal gleich in den Objektinspektor vom Tmediaplayer ein. Oder mach den Code auf'n Buttonklick und schau was passiert.
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Di 06.09.05 08:40 
Mit dem Video wärs net viel schwerer... Du musst nur eine Komponente, die von TWinControl abstammt in die Eigenschaft Display eintragen. Ich habe die besten Ergebnisse mit dem TWebbrowser gemacht. Allerdings sollte man ihn noch ein wenig verstellen, wenn man eine professionellere Handhabung will (z.B. Popup-Menü deaktivieren, eigenes Setzen, usw.). Was passiert, wenn du dem MPlayer nicht gleich per Code .play sagst? Spielt der bei dir dann eigentlich die mp3 ab?

_________________
Programmers never die, they just GOSUB without RETURN
zangelo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 50



BeitragVerfasst: Di 06.09.05 21:04 
user profile iconFabian W. hat folgendes geschrieben:
Trag deine Werte mal gleich in den Objektinspektor vom Tmediaplayer ein. Oder mach den Code auf'n Buttonklick und schau was passiert.

wie es geht weis ich, nur was ich eintragen muss nich :(

Wenn ich den Code in einem Button einfüge schließt sich die Datei, wie wenn ich auf das rote Kreuz klick.

und das am anfang vom Post von alias5000 blick ich nich ;)

und wenn ich das play weglasse passiert nichts :(
zangelo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 50



BeitragVerfasst: Mi 07.09.05 06:39 
ahhhhhh
also ich hab das jetzt wieder in einen Button eingefügt.
mit das ist das hier gemeint:
MediaPlayer1.filename :='C:/test.wav';
MediaPlayer1.open;
MediaPlayer1.play;

Mit dem unterschied, dass ich stat einer .mp3 datei eine .wav genommen habe. jetzt geht es!
kann auch stop drücken und pause :)

Jetzt die für mich am Wichtigste Frage, wie kann ich einen MP3 codec in das Programm einfügen dass das geht?
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Mi 07.09.05 14:04 
Iss mir noch nach dem posten eingefallen. Retnyg hat zum MediaPlayer ein Tutorial geschrieben, das für dich recht passend sein sollte! Zu meinem Post nochmal: Gemeint war das da (um Videos anzuzeigen): MediaPlayer1.Display := Webbrowser1; Wenn du dann mal versuchst eine AVI Datei zu öffnen und abzuspielen, wirst du sie auch sehen.

_________________
Programmers never die, they just GOSUB without RETURN
zangelo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 50



BeitragVerfasst: Mi 07.09.05 18:40 
HI
kapier hab ich es, ton kommt auch, aber leider kommt in WebBrowser1 kein Bild :(
muss man da noch was einstellen?

und kannst du mir viellleicht einen link zu dem Tut geben?
MFG Zangelo
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Mi 07.09.05 19:14 
ausblenden Delphi-Quelltext
1:
2:
Mediaplayer1.Display := Panel1;
Mediaplayer1.Refresh;
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Do 08.09.05 10:27 

_________________
Programmers never die, they just GOSUB without RETURN