AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Delphi Forms

Ein Thema von drama22 · begonnen am 31. Okt 2014 · letzter Beitrag vom 31. Okt 2014
Antwort Antwort
drama22

Registriert seit: 12. Jan 2013
88 Beiträge
 
#1

Delphi Forms

  Alt 31. Okt 2014, 09:09
hi , i have two forms first form have a button to call the second form like this

Delphi-Quellcode:
 secondform.FormStyle := fsStayOnTop;
 secondform.Show;
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 ?
  Mit Zitat antworten Zitat
Der schöne Günther

Registriert seit: 6. Mär 2013
6.110 Beiträge
 
Delphi 10 Seattle Enterprise
 
#2

AW: Delphi Forms

  Alt 31. Okt 2014, 09:12
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 OnClose on your second form and make sure the video is properly shut down.
  Mit Zitat antworten Zitat
drama22

Registriert seit: 12. Jan 2013
88 Beiträge
 
#3

AW: Delphi Forms

  Alt 31. Okt 2014, 09:39
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 OnClose on your second form and make sure the video is properly shut down.
i tried to do somthing like that

Delphi-Quellcode:
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;
thats close the video and its sound but i cant open it again until i close the whole app and re open it

note i load youtube player inside tembeddedwb

Geändert von drama22 (31. Okt 2014 um 09:44 Uhr)
  Mit Zitat antworten Zitat
Benutzerbild von Sherlock
Sherlock

Registriert seit: 10. Jan 2006
Ort: Offenbach
3.762 Beiträge
 
Delphi 11 Alexandria
 
#4

AW: Delphi Forms

  Alt 31. Okt 2014, 09:48
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
Oliver
Geändert von Sherlock (Morgen um 16:78 Uhr) Grund: Weil ich es kann
  Mit Zitat antworten Zitat
drama22

Registriert seit: 12. Jan 2013
88 Beiträge
 
#5

AW: Delphi Forms

  Alt 31. Okt 2014, 14:15
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
is there example on how to stop the player on close ?
  Mit Zitat antworten Zitat
Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#6

AW: Delphi Forms

  Alt 31. Okt 2014, 14:16
I would have expected that embeddedwb.AssignEmptyDocument; should do the job to stop.
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)
  Mit Zitat antworten Zitat
drama22

Registriert seit: 12. Jan 2013
88 Beiträge
 
#7

AW: Delphi Forms

  Alt 31. Okt 2014, 14:28
I would have expected that embeddedwb.AssignEmptyDocument; should do the job to stop.
You saved Me Many Thanks for help i wouldn't note this without you thanks

Geändert von drama22 (31. Okt 2014 um 15:16 Uhr)
  Mit Zitat antworten Zitat
Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#8

AW: Delphi Forms

  Alt 31. Okt 2014, 14:42
I would have expected that embeddedwb.AssignEmptyDocument; should do the job to stop.
yes but cant recreate it if i want to click the form again how do i recreate it after its assign to empty
Why "recreating"?

The problem before was embeddedwb.Free; , because it will free the embeddedwb instance. So get rid of that free and just 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;
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)

Geändert von Sir Rufo (31. Okt 2014 um 14:45 Uhr)
  Mit Zitat antworten Zitat
Dejan Vu
(Gast)

n/a Beiträge
 
#9

AW: Delphi Forms

  Alt 31. Okt 2014, 15:28
Why should we always use 'FreeAndNil' instead of 'Free'?
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 07:46 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz