C# Класс OnlineVideos.MediaPortal2.WebBrowserVideoPlayer

Player which automates a web browser - will minimise MediaPortal and shell to the WebBrowserHost when play is requested
Наследование: IPlayer, IPlayerEvents, IUIContributorPlayer
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
_ended PlayerEventDlgt
_playbackError PlayerEventDlgt
_playbackStateChanged PlayerEventDlgt
_processPath string
_started PlayerEventDlgt
_stateReady PlayerEventDlgt
_stopped PlayerEventDlgt

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
Ended ( ) : void
FireEnded ( ) : void
FirePlaybackStateChanged ( ) : void
FireStarted ( ) : void
FireStateReady ( ) : void
FireStopped ( ) : void

Приватные методы

Метод Описание
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

Описание методов

Dispose() публичный Метод

Clean up
public Dispose ( ) : void
Результат void

Ended() защищенный Метод

protected Ended ( ) : void
Результат void

FireEnded() защищенный Метод

protected FireEnded ( ) : void
Результат void

FirePlaybackStateChanged() защищенный Метод

protected FirePlaybackStateChanged ( ) : void
Результат void

FireStarted() защищенный Метод

protected FireStarted ( ) : void
Результат void

FireStateReady() защищенный Метод

protected FireStateReady ( ) : void
Результат void

FireStopped() защищенный Метод

protected FireStopped ( ) : void
Результат void

Init() публичный Метод

public Init ( MediaItem mediaItem ) : bool
mediaItem MediaItem
Результат bool

InitializePlayerEvents() публичный Метод

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
Результат void

Play() публичный Метод

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
Результат bool

Prepare() публичный Метод

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
Результат void

ResetPlayerEvents() публичный Метод

public ResetPlayerEvents ( ) : void
Результат void

Stop() публичный Метод

public Stop ( ) : void
Результат void

SuspendMP() публичный Метод

Suspend mediaportal and hide the window
public SuspendMP ( bool suspend ) : void
suspend bool
Результат void

_callback_OnBrowserKeyPress() публичный Метод

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
Результат void

Описание свойств

_ended защищенное свойство

protected PlayerEventDlgt _ended
Результат PlayerEventDlgt

_playbackError защищенное свойство

protected PlayerEventDlgt _playbackError
Результат PlayerEventDlgt

_playbackStateChanged защищенное свойство

protected PlayerEventDlgt _playbackStateChanged
Результат PlayerEventDlgt

_processPath защищенное свойство

protected string _processPath
Результат string

_started защищенное свойство

protected PlayerEventDlgt _started
Результат PlayerEventDlgt

_stateReady защищенное свойство

protected PlayerEventDlgt _stateReady
Результат PlayerEventDlgt

_stopped защищенное свойство

protected PlayerEventDlgt _stopped
Результат PlayerEventDlgt