Bug 5365 - QuickTime plugin keeps playing audio after being destroyed
Summary: QuickTime plugin keeps playing audio after being destroyed
Alias: None
Product: WebKit
Classification: Unclassified
Component: Plug-ins (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Chris Blumenberg
: 6082 (view as bug list)
Depends on:
Reported: 2005-10-13 04:23 PDT by mitz
Modified: 2005-12-14 14:15 PST (History)
1 user (show)

See Also:

testcase (uses external resource) (947 bytes, text/html)
2005-10-13 04:25 PDT, mitz
no flags Details
stop and destroy plugin when removed (2.45 KB, patch)
2005-10-14 09:09 PDT, mitz
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2005-10-13 04:23:01 PDT
Summary: The QuickTime plugin continues to play audio after the OBJECT or EMBED element containing 
it is removed from the page.

To reproduce:
1) Open the testcase in Safari
2) As soon as audio starts, click the Remove OBJECT link
3) Close the window

Expected: audio to stop in step 2

Actual: audio only stops in step 3

More information: when the OBJECT element is removed, QWidget::removeFromSuperview() is called, 
which sends -removeFromSuperview on the plugin's NSView. In WebNetscapePluginView, this stops the 
plugin. In the QuickTime plugin, it does not. The view is only deallocated when the window is closed, 
and then audio stops.
Comment 1 mitz 2005-10-13 04:25:31 PDT
Created attachment 4340 [details]
testcase (uses external resource)
Comment 2 mitz 2005-10-14 09:09:31 PDT
Created attachment 4360 [details]
stop and destroy plugin when removed

Send -webPlugInStop (or -pluginStop) and -webPluginDestroy (or -pluginDestroy)
to complying plugins right when they're removed from the WebHTMLView, and also
release them from the plugin controller's arrays.

I think this patch makes WebKit behave more like plugins expect it to, which is
the way it already behaves with Netscape plugins.

I expect complying plugins to stop making noise when receiving the stop
message, but QuickTime doesn't. If it's lucky, then it will be deallocated
because of the release and will stop then. However, JS, for one, can retain the
plugin (e.g. if you execute <javascript:document.getElementById('obj').width;>
before clicking Remove OBJECT), in which case it will just keep playing.
Comment 3 Dave Hyatt 2005-10-17 20:44:18 PDT
Comment on attachment 4360 [details]
stop and destroy plugin when removed

Comment 4 mitz 2005-10-24 13:14:58 PDT
Tim Omernick landed the patch.
Comment 5 mitz 2005-12-14 14:15:43 PST
*** Bug 6082 has been marked as a duplicate of this bug. ***