![]() |
Delphi Forms
hi , i have two forms first form have a button to call the second form like this
Delphi-Quellcode:
the second form have a embeddedwb with youtube player my problem is if i close the second form when youtube is playing it doesn't stop playing the youtube video until i close the whole application any solve for this ?
secondform.FormStyle := fsStayOnTop;
secondform.Show; |
AW: Delphi Forms
Since you posted no details, we don't have the slightest clue how that "youtube player" works.
You will have to implement an event handler for
Delphi-Quellcode:
on your second form and make sure the video is properly shut down.
OnClose
|
AW: Delphi Forms
Zitat:
Delphi-Quellcode:
thats close the video and its sound but i cant open it again until i close the whole app and re open it
procedure secondform.FormClose(Sender: TObject; var Action: TCloseAction);
begin embeddedwb.AssignEmptyDocument; embeddedwb.Free; end; procedure secondform.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin CanClose := True; Self.Hide; end; note i load youtube player inside tembeddedwb |
AW: Delphi Forms
Well, if you destroy the player, and reuse the form, without recreating it...how should the player do its work?
Either don't free the player and just try stopping the video or recreate the player when the form is shown agein. Sherlock |
AW: Delphi Forms
Zitat:
|
AW: Delphi Forms
I would have expected that
Delphi-Quellcode:
should do the job to stop.
embeddedwb.AssignEmptyDocument;
|
AW: Delphi Forms
Zitat:
|
AW: Delphi Forms
Zitat:
The problem before was
Delphi-Quellcode:
, because it will free the
embeddedwb.Free;
Delphi-Quellcode:
instance. So get rid of that free and just
embeddedwb
Delphi-Quellcode:
.
AssignEmptyDocument
Delphi-Quellcode:
procedure secondform.FormClose(Sender: TObject; var Action: TCloseAction);
begin embeddedwb.AssignEmptyDocument; // I must not destroy my toys if I want to play again with // embeddedwb.Free; end; |
AW: Delphi Forms
Why should we always use 'FreeAndNil' instead of 'Free'? :gruebel: ;-)
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 13:31 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz