I load a youtube video with QWebView by the following code ,when the video is playing I close the QWebView window ,but I still can hear the voice from that video even when QWebView window is closed, so is there any way to stop the sound by code when QWebView window is closed ?
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
import sys
app = QApplication(sys.argv)
view = QWebView()
view.resize(1230,760)
view.settings().setAttribute(QWebSettings.PluginsEnabled, True)
view.load(QUrl("http://www.youtube.com/v/nKIu9yen5nc")) #
#
view.show()
sys.exit(app.exec_())
来源:https://stackoverflow.com/questions/15983148/the-sound-dont-stop-when-qwebview-window-closed-loaded-with-youtube-video