ginga 1.0
The Ginga iTV middleware
|
A player class for HTML. More...
#include <PlayerHTML.h>
Public Member Functions | |
PlayerHTML (const string &location) | |
Default constructor for PlayerHTML. | |
virtual | ~PlayerHTML () |
Default destructor for PlayerHTML. | |
virtual bool | play () override |
Start the presentation. | |
virtual void | stop () override |
Stop the presentation. | |
virtual void | handleKeyEvent (SDL_EventType type, SDL_Keycode key) override |
Process keyboard input events. | |
virtual void | handleTickEvent (Time, Time, int) override |
![]() | |
Player (Formatter *, Media *) | |
State | getState () |
void | getZ (int *, int *) |
bool | isFocused () |
Time | getTime () |
void | incTime (Time) |
Time | getDuration () |
void | setDuration (Time) |
bool | getEOS () |
void | setEOS (bool) |
virtual void | start () |
virtual void | pause () |
virtual void | resume () |
virtual string | getProperty (const string &) |
virtual void | setProperty (const string &, const string &) |
void | resetProperties () |
void | resetProperties (set< string > *) |
void | schedulePropertyAnimation (const string &, const string &, const string &, Time) |
virtual void | reload () |
virtual void | redraw (cairo_t *) |
virtual void | sendKeyEvent (const string &, bool) |
virtual void | sendPresentationEvent (const string &, const string &) |
Private Member Functions | |
bool | displayJobCallback (DisplayJob *job, SDL_Renderer *renderer) |
Defines the job actions to be executed by the renderer. | |
void | mouseInputCallback (SDL_EventType type, int x, int y) |
Process mouse input events. | |
int | getPlayerKey (SDL_Keycode key) |
Translate a SDL key code to a CEF key code. | |
Static Private Member Functions | |
static bool | displayJobCallbackWrapper (DisplayJob *job, SDL_Renderer *renderer, void *self) |
Defines mutex methods. | |
Private Attributes | |
CefRefPtr< GingaCefHandler > | _handler |
Keep the active handler instance, needed to create a new client instance. | |
CefRefPtr< GingaCefClient > | _client |
Keep the active client instance, needed to create a new browser instance. | |
CefRefPtr< CefBrowser > | _browser |
Keep the active browser instance. | |
bool | _isPlaying |
Keep execution player status. | |
Additional Inherited Members | ||
![]() | ||
enum | State { SLEEPING = 1 , OCCURRING , PAUSED } | |
enum | Property { PROP_UNKNOWN = 0 , PROP_BACKGROUND , PROP_BALANCE , PROP_BASS , PROP_BOTTOM , PROP_BOUNDS , PROP_DEBUG , PROP_DURATION , PROP_EXPLICIT_DUR , PROP_FOCUS_INDEX , PROP_FOCUS_BORDER_COLOR , PROP_FOCUS_BORDER_WIDTH , PROP_FOCUS_BORDER_TRANSPARENCY , PROP_SEL_BORDER_COLOR , PROP_FONT_BG_COLOR , PROP_FONT_COLOR , PROP_FONT_FAMILY , PROP_FONT_SIZE , PROP_FONT_STYLE , PROP_FONT_VARIANT , PROP_FONT_WEIGHT , PROP_FREEZE , PROP_FREQ , PROP_HEIGHT , PROP_HORZ_ALIGN , PROP_LEFT , PROP_LOCATION , PROP_MUTE , PROP_RIGHT , PROP_SIZE , PROP_SPEED , PROP_TIME , PROP_TOP , PROP_TRANSPARENCY , PROP_TREBLE , PROP_TYPE , PROP_URI , PROP_VERT_ALIGN , PROP_VISIBLE , PROP_VOLUME , PROP_WAVE , PROP_WIDTH , PROP_Z_INDEX , PROP_Z_ORDER , PROP_REMOTE_PLAYER_BASE_URL } | |
![]() | ||
static string | getCurrentFocus () | |
static void | setCurrentFocus (const string &) | |
static Property | getPlayerProperty (const string &, string *) | |
static bool | getMimeForURI (const string &, string *) | |
static Player * | createPlayer (Formatter *, Media *, const string &, const string &type="") | |
![]() | ||
virtual bool | doSetProperty (Property, const string &, const string &) | |
![]() | ||
Formatter * | _formatter | |
Media * | _media | |
string | _id | |
State | _state | |
Time | _time | |
bool | _eos | |
cairo_surface_t * | _surface | |
bool | _opengl | |
guint | _gltexture | |
bool | _dirty | |
PlayerAnimator * | _animator | |
list< int > | _crop | |
map< string, string > | _properties | |
struct { | ||
Color bgColor | ||
Rect rect | ||
Time duration | ||
bool debug | ||
bool visible | ||
guint8 alpha | ||
int zindex | ||
int zorder | ||
string focusIndex | ||
Color focusBorderColor | ||
int focusBorderWidth | ||
guint8 focusBorderTransparency | ||
Color selBorderColor | ||
string type | ||
string uri | ||
} | _prop | |
A player class for HTML.
This class is responsible to present HTML pages. The player use the Chromium Embedded Framework (CEF) together with SDL to render the result in the screen.
|
explicit |
|
virtual |
Default destructor for PlayerHTML.
|
private |
Defines the job actions to be executed by the renderer.
job | The job data. |
renderer | The renderer. |
This method create a new browser and load the page to be render in the screen. In case the browser already exist, just process the browser events and update the screen. Return false only when stop() is called.
|
staticprivate |
Defines mutex methods.
This MACRO is defined in src/ginga.h.
Defines the job actions to be executed by the renderer.
job | The job data. |
renderer | The renderer. |
self | The object instance. |
Actually, this is just a wrapper to displayJobCallback().
|
private |
Translate a SDL key code to a CEF key code.
key | A SDL key code. |
|
overridevirtual |
Process keyboard input events.
type | A SDL event type (SDL_KEYDOWN or SDL_KEYUP). |
key | A SDL key code. |
This method translate the key code captured by SDL in the event to the CEF code style and forward the events to the active browser.
|
private |
Process mouse input events.
type | A SDL event type (SDL_MOUSEBUTTONDOWN or SDL_MOUSEBUTTONUP) |
x | The X coordinate, relative to window. |
y | The Y coordinate, relative to window. |
This method forward the events captured by SDL to the active browser.
|
overridevirtual |
Start the presentation.
This method adds a new display job to start the presentation.
|
overridevirtual |
Stop the presentation.
This method stop the presentation by finishing the display job and cleaning the screen.
Reimplemented from ginga::Player.