Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MythFlashPlayer: Perform seeks based on the seek amounts of the defau…

…lt playgroup.

Also add a mythflashplayer API for volume control, thanks to a patch from Jonatan Martens.

Refs ticket 9301.
  • Loading branch information...
commit a746d462a9f8a37c4b73d146030ae77f30944f92 1 parent d5a786d
Robert McNamara authored
View
16 mythplugins/mythbrowser/mythbrowser/mythflashplayer.cpp
@@ -10,6 +10,7 @@
#include <mythcontext.h>
#include <libmythui/mythmainwindow.h>
#include <mythuiwebbrowser.h>
+#include <playgroup.h>
// mythbrowser
#include "webpage.h"
@@ -22,6 +23,9 @@ MythFlashPlayer::MythFlashPlayer(MythScreenStack *parent,
: MythScreenType (parent, "mythflashplayer"),
m_browser(NULL), m_url(urlList[0])
{
+ m_fftime = PlayGroup::GetSetting("Default", "skipahead", 30);
+ m_rewtime = PlayGroup::GetSetting("Default", "skipback", 5);
+ m_jumptime = PlayGroup::GetSetting("Default", "jump", 10);
qApp->setOverrideCursor(QCursor(Qt::BlankCursor));
}
@@ -75,13 +79,17 @@ bool MythFlashPlayer::keyPressEvent(QKeyEvent *event)
if (action == "PAUSE")
evaluateJavaScript("play();");
else if (action == "SEEKFFWD")
- evaluateJavaScript("seek(10);");
+ evaluateJavaScript(QString("seek(%1);").arg(m_fftime));
else if (action == "SEEKRWND")
- evaluateJavaScript("seek(-10);");
+ evaluateJavaScript(QString("seek(-%1);").arg(m_rewtime));
else if (action == "CHANNELUP")
- evaluateJavaScript("seek(60);");
+ evaluateJavaScript(QString("seek(%1);").arg(m_jumptime * 60));
else if (action == "CHANNELDOWN")
- evaluateJavaScript("seek(-60);");
+ evaluateJavaScript(QString("seek(-%1);").arg(m_jumptime * 60));
+ else if (action == "VOLUMEUP")
+ evaluateJavaScript("adjustVolume(2);");
+ else if (action == "VOLUMEDOWN")
+ evaluateJavaScript("adjustVolume(-2);");
else
handled = false;
View
3  mythplugins/mythbrowser/mythbrowser/mythflashplayer.h
@@ -20,6 +20,9 @@ class MythFlashPlayer : public MythScreenType
QVariant evaluateJavaScript(const QString&);
MythUIWebBrowser* m_browser;
QString m_url;
+ int m_fftime;
+ int m_rewtime;
+ int m_jumptime;
};
#endif
Please sign in to comment.
Something went wrong with that request. Please try again.