Player Class

From DevWiki

Jump to: navigation, search

Applications,Python API,MC Module

Contents


Player

mc.GetPlayer()
This class represents the player object, used for playing all kinds of media items.

  1. player = mc.GetPlayer()
  1. <onclick lang="python"><![CDATA[
  2. player = mc.GetPlayer()
  3. ]]></onclick>


PLAYER_ACTION

Player Action Constants.

  • XAPP_PLAYER_ACTION_NONE
  • XAPP_PLAYER_ACTION_NEXT
  • XAPP_PLAYER_ACTION_PREV
  • XAPP_PLAYER_ACTION_STOP


PLAYER_EVENT

Player Event Constants.
Events generated by mc.GetPlayer().

  • EVENT_NEXT_ITEM
  • EVENT_STOPPED
  • EVENT_ENDED
  • EVENT_STARTED
  • EVENT_NONE


GetLastPlayerAction

GetLastPlayerAction():Player::PLAYER_ACTION
Get last action performed by the mc.GetPlayer().

  1. lastAction = mc.GetPlayer().GetLastPlayerAction()


GetPlayingItem

GetPlayingItem():ListItem
Returns the currently playing item.

  1. item = mc.GetPlayer().GetPlayingItem()


GetTime

GetTime():Float
Returns the current time in seconds of the currently playing media. Fractional portions of a second are possible. This returns a double to be consistent with and . Throws an exception if no item is currently playing.

  1. if mc.GetPlayer().GetTime() > 60.550:
  2.    ...


GetTotalTime

GetTotalTime():Float
Returns the total time in seconds of the current media. Fractional portions of a second are possible - but not necessarily supported by the player class. This returns a double to be consistent with and . Throws an exception if no item is currently playing.

  1. if mc.GetPlayer().GetTotalTime() > 200.544:
  2.    ...


GetVolume

GetVolume():Integer
Returns current volume of the application.

  1. currentVolume = mc.GetPlayer().GetVolume()


IsCaching

IsCaching():Boolean
Returns true if the player is currently at the caching phase.

  1. if mc.GetPlayer().IsCaching():
  2.    ...


IsForwarding

IsForwarding():Boolean
Returns true if the player is currently perfroming fast forward operation.

  1. if mc.GetPlayer().IsForwarding():
  2.    ...


IsPaused

IsPaused():Boolean
Returns true if playback is paused.

  1. if mc.GetPlayer().IsPaused():
  2.    ...


IsPlaying

IsPlaying():Boolean
Returns true if Boxee is currently playing media, false otherwise.

  1. if mc.GetPlayer().IsPlaying():
  2.    ...


IsPlayingAudio

IsPlayingAudio():Boolean
Returns true if Boxee is currently playing audio, false otherwise.

  1. if mc.GetPlayer().IsPlayingAudio():
  2.    ...


IsPlayingVideo

IsPlayingVideo():Boolean
Returns true if Boxee is currently playing video, false otherwise.

  1. if mc.GetPlayer().IsPlayingVideo():
  2.    ...


IsRewinding

IsRewinding(void):Boolean
Returns true if the player is currently perfroming rewind operation.

  1. if mc.GetPlayer().IsRewinding():
  2.    ...


LockPlayerAction

LockPlayerAction(Player::PLAYER_ACTION:enum):Void
Disable specific player action. Use XAPP_PLAYER_ACTION_NONE to unlock all action.

  1. mc.GetPlayer().LockPlayerAction(mc.GetPlayer().XAPP_PLAYER_ACTION_STOP)


Pause

Pause():Void
Pause playback.

  1. mc.GetPlayer().Pause()


Play

Play(item:ListItem):Void
Plays the specified list item.

  1. mc.GetPlayer().Play(listItem)


Player

Player([registerCallbacks=false:Boolean]):Player
Creates a new player object. RegisterCallbacks indicates whether player action and event callbacks are tracked, false by default. If you enable callbacks you must have a single instance of a player in your application.

  1. mc.GetPlayer().Player()


PlayInBackground

PlayInBackground(item:ListItem):Void
Plays the specified list item. Differs from Play() in that PlayInBackground() plays specified list item, but does not change the focus of the application to the Boxee mc.GetPlayer(). The application can then display the video in its own videowindow control.

  1. mc.GetPlayer().PlayInBackground(listItem)


PlayNext

PlayNext():Void
Skip to next item in the playlist.

  1. mc.GetPlayer().PlayNext()


PlayPrevious

PlayPrevious():Void
Skip to the previous item in the playlist.

  1. mc.GetPlayer().PlayPrevious()


PlaySelected

PlaySelected(itemIndex:Integer):Void
Play item with specified index from the current playlist.

  1. mc.GetPlayer().PlaySelected(4)


PlayWithActionMenu

PlayWithActionMenu(item:ListItem):Void
Open Media Action Dialog on specified item.

  1. mc.GetPlayer().PlayWithActionMenu(listItem)


SeekTime

SeekTime(seekTime:Float):Void
Sets the current position of the currently playing media to the specified time in seconds. Fractional portions of a second are valid. The passed time is the time offset from the beginning of the file as opposed to a delta from the current position.

  1. mc.GetPlayer().SeekTime(45.885)


SetLastPlayerAction

SetLastPlayerAction(Player::PLAYER_ACTION:enum):Void
Set last player action.

  1. mc.GetPlayer().SetlastPlayerAction(mc.GetPlayer().XAPP_PLAYER_ACTION_STOP)


SetLastPlayerEvent

SetLastPlayerEvent(Player::PLAYER_EVENT:enum):Void
Set player event.

  1. mc.GetPlayer().SetLastPlayerEvent(mc.GetPlayer().EVENT_ENDED)


SetVolume

SetVolume(percent:Integer):Void
Set Boxee volume.

  1. mc.GetPlayer().SetVolume(100)


Stop

Stop():Void
Stops playback.

  1. mc.GetPlayer().Stop()


ToggleMute

ToggleMute():Void
Mute Boxee.

  1. mc.GetPlayer().Mute()
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox