C# Class OnlineVideos.MediaPortal2.WebBrowserVideoPlayer

Player which automates a web browser - will minimise MediaPortal and shell to the WebBrowserHost when play is requested
Inheritance: IPlayer, IPlayerEvents, IUIContributorPlayer
Afficher le fichier Open project: offbyoneBB/mp-onlinevideos2 Class Usage Examples

Protected Properties

Свойство Type Description
_ended PlayerEventDlgt
_playbackError PlayerEventDlgt
_playbackStateChanged PlayerEventDlgt
_processPath string
_started PlayerEventDlgt
_stateReady PlayerEventDlgt
_stopped PlayerEventDlgt

Méthodes publiques

Méthode Description
Dispose ( ) : void

Clean up

Init ( MediaItem mediaItem ) : bool
InitializePlayerEvents ( PlayerEventDlgt started, PlayerEventDlgt stateReady, PlayerEventDlgt stopped, PlayerEventDlgt ended, PlayerEventDlgt playbackStateChanged, PlayerEventDlgt playbackError ) : void
Play ( ) : bool

Play the specified file - file will actually be the video id from the website This method will hide MediaPortal and run the BrowserHost - BorwserHost needs to support the WebAutomationType and have the code to actually navigate to the site

Prepare ( MediaItem mediaItem ) : void

We require the command line parameters for the web browser host Util should be an implementation of IBrowserSiteUtil

ResetPlayerEvents ( ) : void
Stop ( ) : void
SuspendMP ( bool suspend ) : void

Suspend mediaportal and hide the window

_callback_OnBrowserKeyPress ( int keyPressed ) : void

When the browser has a key press, try and map it to an action and fire the on action

Méthodes protégées

Méthode Description
Ended ( ) : void
FireEnded ( ) : void
FirePlaybackStateChanged ( ) : void
FireStarted ( ) : void
FireStateReady ( ) : void
FireStopped ( ) : void

Private Methods

Méthode Description
BrowserProcess_Exited ( object sender, EventArgs e ) : void

Restore the MP window

GetRunningProcess ( string processName ) : void
InstanceOnKeyPressed ( MediaPortal.UI.Control.InputManager.Key &key ) : void

When a new action is received we'll forward them to the browser host using a WCF service

IsPassThrough ( MediaPortal.UI.Control.InputManager.Key key, string &action ) : bool

Handles key presses that should be simply forwarded to client (especially number keys).

KillBrowserProcess ( ) : void

Kill the browser process if it's set to an instance

ProcessActionArguments ( string &action ) : void
Redirect ( StreamReader input ) : void

Read the standard streams using a separate thread

ReinitialiseService ( ) : void

Initialise the connection to the service

Shutdown ( ) : void
ToggleMinimise ( bool shouldMinimise ) : void

We'll use reflection to call in to some core MediaPortal methods to minimise to the system tray This seems to work better that other methods I've found because they cause MediaPortal to hog a core when set to suspending

_callback_OnBrowserHostClosing ( object sender, EventArgs e ) : void

Handles the event from the browser host telling us its closing

Method Details

Dispose() public méthode

Clean up
public Dispose ( ) : void
Résultat void

Ended() protected méthode

protected Ended ( ) : void
Résultat void

FireEnded() protected méthode

protected FireEnded ( ) : void
Résultat void

FirePlaybackStateChanged() protected méthode

protected FirePlaybackStateChanged ( ) : void
Résultat void

FireStarted() protected méthode

protected FireStarted ( ) : void
Résultat void

FireStateReady() protected méthode

protected FireStateReady ( ) : void
Résultat void

FireStopped() protected méthode

protected FireStopped ( ) : void
Résultat void

Init() public méthode

public Init ( MediaItem mediaItem ) : bool
mediaItem MediaItem
Résultat bool

InitializePlayerEvents() public méthode

public InitializePlayerEvents ( PlayerEventDlgt started, PlayerEventDlgt stateReady, PlayerEventDlgt stopped, PlayerEventDlgt ended, PlayerEventDlgt playbackStateChanged, PlayerEventDlgt playbackError ) : void
started PlayerEventDlgt
stateReady PlayerEventDlgt
stopped PlayerEventDlgt
ended PlayerEventDlgt
playbackStateChanged PlayerEventDlgt
playbackError PlayerEventDlgt
Résultat void

Play() public méthode

Play the specified file - file will actually be the video id from the website This method will hide MediaPortal and run the BrowserHost - BorwserHost needs to support the WebAutomationType and have the code to actually navigate to the site
public Play ( ) : bool
Résultat bool

Prepare() public méthode

We require the command line parameters for the web browser host Util should be an implementation of IBrowserSiteUtil
public Prepare ( MediaItem mediaItem ) : void
mediaItem MediaItem
Résultat void

ResetPlayerEvents() public méthode

public ResetPlayerEvents ( ) : void
Résultat void

Stop() public méthode

public Stop ( ) : void
Résultat void

SuspendMP() public méthode

Suspend mediaportal and hide the window
public SuspendMP ( bool suspend ) : void
suspend bool
Résultat void

_callback_OnBrowserKeyPress() public méthode

When the browser has a key press, try and map it to an action and fire the on action
public _callback_OnBrowserKeyPress ( int keyPressed ) : void
keyPressed int Key pressed in browser
Résultat void

Property Details

_ended protected_oe property

protected PlayerEventDlgt _ended
Résultat PlayerEventDlgt

_playbackError protected_oe property

protected PlayerEventDlgt _playbackError
Résultat PlayerEventDlgt

_playbackStateChanged protected_oe property

protected PlayerEventDlgt _playbackStateChanged
Résultat PlayerEventDlgt

_processPath protected_oe property

protected string _processPath
Résultat string

_started protected_oe property

protected PlayerEventDlgt _started
Résultat PlayerEventDlgt

_stateReady protected_oe property

protected PlayerEventDlgt _stateReady
Résultat PlayerEventDlgt

_stopped protected_oe property

protected PlayerEventDlgt _stopped
Résultat PlayerEventDlgt