Autor Beitrag
Chrissyx
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26

Win 98SE, Win XP
Delphi 2005
BeitragVerfasst: Do 27.05.04 21:50 
Wie kann man mit dem TMediaPlayer etwas direkt aus einer .res Datei abspielen? Wie das bei Sounds geht, weiss ich bereits, aber wie geht das z.B. mit Videos?

Danke für irgendwelche Antworten! :)
Cruiser23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: Sa 29.05.04 14:24 
Vieleicht hilft dir das weiter:

ausblenden Delphi-Quelltext
1:
2:
3:
Animate1.ResName := HInstance;
Animate1.FileName := LoadFromFile('BlaAni');
Animate1.Play(x1, x2, x3); // x1= StartFrame; x2=StopFrame; x3=LoppAnzahl (0 = DauerReplay)


In die x.Rc schreibst du :
ausblenden Quelltext
1:
BlaAni AVI "C:\BlaAvi.avi"					

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!
Chrissyx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26

Win 98SE, Win XP
Delphi 2005
BeitragVerfasst: Sa 29.05.04 18:17 
Hmmm, hilft mir nicht wirklich. Ich glaube zwar, das LoadFromFile der gesuchte Befehl ist, aber ich kann den nicht anwenden. Delphi sagt, es kennt den Befehl nicht. Muss ich da noch eine Unit einbinden, wie z.B. "uses math"?
Ich hab derzeit das hier stehen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
var rs: TCustomMemoryStream;
    F: file;
    temp: string;
    dir: array[0..MAX_PATH+1] of char;
begin
   GetTempPath (SizeOf(dir), dir); //temp Pfad ermitteln
   temp := string(dir);
   temp := temp + 'temp.wmv';
   rs := TResourceStream.Create(hInstance, 'kill2', 'wmv'); //video aus res auslesen
   rs.SaveToFile(temp); //video im temp ordner speichern
   rs.Free;
   MediaPlayer1.FileName := temp; //video in mediaplayer laden
   MediaPlayer1.Open;
   MediaPlayer1.Play;
   //MediaPlayer1.DisplayRect := Rect (0, 0, screen.Width, screen.Height);
   sleep (45500); //warten, bis video abgespielt ist
   MediaPlayer1.Close;
   AssignFile (F, temp);
   erase (F); //video datei löschen


Wie man sieht, hab ich auch noch ein Problem, das Video auf Vollbild zu bekommen, aber das ist eine andere Sache. Wie kann ich denn jetzt LoadFromFile mit TMediaPlayer1 kombinieren? Sowas wie

ausblenden Delphi-Quelltext
1:
MediaPlayer1.FileName := LoadFromFile('kill2');					


geht irgendwie nicht. :( Den Befehl ResName kennt TMediaPlayer auch nicht. Dieses TAnimate ist für wmv Videos auch eher ungeeigent. Hat wer eine Idee? :?:
Cruiser23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: So 30.05.04 19:43 
ausblenden Delphi-Quelltext
1:
2:
if OpenDialog1.Execute then
  MediaPlayer1.FileName := Opendialog1.FileName;


besser?

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!
Chrissyx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26

Win 98SE, Win XP
Delphi 2005
BeitragVerfasst: So 30.05.04 20:08 
OpenDialog? Nein! Ohne Dateiauswahlfenster und seit wann kann man damit Dateien aus einer res öffnen?!? :?:
Ich kann mir nicht vorstellen, dass ich der erste bin, der fragt, wie man ein Video direkt aus einer res Datei abspielen kann. :shock: Bei Sounds geht das doch so einfach, warum nicht bei Videos? :(
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Mo 31.05.04 11:50 
Chrissyx hat folgendes geschrieben:
Ich kann mir nicht vorstellen, dass ich der erste bin, der fragt, wie man ein Video direkt aus einer res Datei abspielen kann.


Hat bestimmt schonmal einer gefragt (> Suchen?). Aber du bist wahrscheinlich der erste der das in ZWEI Threads fragt: www.delphi-forum.de/viewtopic.php?t=25218

raziel

_________________
JSXGraph
Chrissyx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26

Win 98SE, Win XP
Delphi 2005
BeitragVerfasst: Di 01.06.04 22:30 
Hier geht's ja allgemein um Dateien. In dem anderen nur um das Video selber.
Und wenn ich was gefunden hätte, würde ich euch nicht nerven! :D
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Mi 02.06.04 09:20 
Chrissyx hat folgendes geschrieben:
Wie kann man mit dem TMediaPlayer etwas direkt aus einer .res Datei abspielen? Wie das bei Sounds geht, weiss ich bereits, aber wie geht das z.B. mit Videos?

Danke für irgendwelche Antworten! :)


Hier gehts auch um videos, genau wie im anderen thread. doppelpostings sind aber nicht gestattet.

raziel

_________________
JSXGraph
Chrissyx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26

Win 98SE, Win XP
Delphi 2005
BeitragVerfasst: Mi 02.06.04 23:15 
Ja, dann löscht doch das andere Thema... :/
btt?