summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets/api/qwebenginepage.h
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@theqtcompany.com>2015-12-14 14:54:39 +0100
committerAlexandru Croitor <alexandru.croitor@theqtcompany.com>2015-12-15 17:03:10 +0000
commit26aa7e314e58ea7be375fc767f6806127e50338d (patch)
treef1575597351effd890379420fca63f04100d8e87 /src/webenginewidgets/api/qwebenginepage.h
parent6414f93b39c57b2718a622430f7e0329b3512c8b (diff)
Add support for checking if audio is played in a page.
Add support for checking if audio is played in a page, as well as the ability to (un)mute the audio. Modify demobrowser example to show (muted) in the tab title, if the tab is muted, or (audible) if there is audio playing in the tab. Fix HTML5 audio/video (un)mute to also work. Change-Id: I7213645e67be2f9da1c5f96cdf6c7eef5341ae4b Task-number: QTBUG-48788 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'src/webenginewidgets/api/qwebenginepage.h')
-rw-r--r--src/webenginewidgets/api/qwebenginepage.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/webenginewidgets/api/qwebenginepage.h b/src/webenginewidgets/api/qwebenginepage.h
index b3c592708..7c9495199 100644
--- a/src/webenginewidgets/api/qwebenginepage.h
+++ b/src/webenginewidgets/api/qwebenginepage.h
@@ -72,6 +72,7 @@ class QWEBENGINEWIDGETS_EXPORT QWebEnginePage : public QObject {
Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
Q_PROPERTY(QSizeF contentsSize READ contentsSize NOTIFY contentsSizeChanged)
Q_PROPERTY(QPointF scrollPosition READ scrollPosition NOTIFY scrollPositionChanged)
+ Q_PROPERTY(bool audioMuted READ isAudioMuted WRITE setAudioMuted NOTIFY audioMutedChanged)
public:
enum WebAction {
@@ -247,6 +248,10 @@ public:
QColor backgroundColor() const;
void setBackgroundColor(const QColor &color);
+ bool isAudioMuted() const;
+ void setAudioMuted(bool muted);
+ bool wasRecentlyAudible();
+
Q_SIGNALS:
void loadStarted();
void loadProgress(int progress);
@@ -274,6 +279,8 @@ Q_SIGNALS:
void scrollPositionChanged(const QPointF &position);
void contentsSizeChanged(const QSizeF &size);
+ void audioMutedChanged(bool muted);
+ void wasRecentlyAudibleChanged(bool wasRecentlyAudible);
protected:
virtual QWebEnginePage *createWindow(WebWindowType type);