the sound don't stop when QWebView window closed (loaded with youtube video)

无人久伴 提交于 2019-12-01 10:53:14

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!