1. press button "Button1" - start play
2. press button "Button2" - stop play
3. press button "Button2" - destroy TVLCPlugin2
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
begin
vlc:=TVLCPlugin2.Create(self);
vlc.Parent:=Self;
vlc.Top:=0;
vlc.Left:=0;
vlc.Width:=300;
vlc.Height:=200;
vlc.Visible:=true;
vlc.playlist.add('udp://@224.100.0.1:1234','udp://@224.100.0.1:1234',null);
vlc.playlist.playItem(0);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
vlc.playlist.stop;
vlc.playlist.clear;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
vlc.Destroy; {or FreeAndNil(vlc);}
end;
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
begin
vlc:=TVLCPlugin2.Create(self);
vlc.Parent:=Self;
vlc.Top:=0;
vlc.Left:=0;
vlc.Width:=300;
vlc.Height:=200;
vlc.Visible:=true;
vlc.playlist.add('udp://@224.100.0.1:1234','udp://@224.100.0.1:1234',null);
vlc.playlist.playItem(0);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
vlc.playlist.stop;
vlc.playlist.clear;
sleep(10000);
vlc.Destroy; {or FreeAndNil(vlc);}
end;
Sequence of actions:
1. stop playing clip
2. clear playlist
3. add new clip to playlist
4. start play clip.
At a playing stop periodically VLC broken.
How correctly to stop play?
How correctly to destroy object?
Code: Select all
vlc.playlist.stop;
vlc.playlist.clear;
vlc.playlist.add('udp://@224.100.0.1:1234','udp://@224.100.0.1:1234',null);
vlc.playlist.playItem(0);