Skip to content
Permalink
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
Robert McNamara
Robert McNamara committed Dec 7, 2010
1 parent d5a786d commit a746d462a9f8a37c4b73d146030ae77f30944f92
@@ -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;

@@ -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

0 comments on commit a746d46

Please sign in to comment.
You can’t perform that action at this time.