KDE 4.5 PyKDE API Reference

- KDE's Python API

# VideoWidget Class Reference

`from PyKDE4.plasma import *`

Inherits: QGraphicsProxyWidget → QGraphicsWidget → QObject
Namespace: Plasma

## Detailed Description

VideoWidget plasma/widgets/videowidget.h <Plasma/Widgets/VideoWidget> a Video playing widget via Phonon, it encloses the Phonon.MediaObject and Phonon.AudioOutput too

Provides a video player widget

Since:
  KDE4.3

## Enumerations
Control | { NoControls, Play, Pause, Stop, PlayPause, Previous, Next, Progress, Volume, OpenFile, DefaultControls }
## Signals
| aboutToFinish ()
| nextRequested ()
| previousRequested ()
| tick (long time)
## Methods
| __init__ (self, QGraphicsWidget parent=0)
bool | controlsVisible (self)
long | currentTime (self)
| hoverEnterEvent (self, QGraphicsSceneHoverEvent event)
| hoverLeaveEvent (self, QGraphicsSceneHoverEvent event)
| hoverMoveEvent (self, QGraphicsSceneHoverEvent event)
| pause (self)
| play (self)
long | remainingTime (self)
| resizeEvent (self, QGraphicsSceneResizeEvent event)
| seek (self, long time)
| setControlsVisible (self, bool visible)
| setStyleSheet (self, QString stylesheet)
| setUrl (self, QString url)
| setUsedControls (self, Plasma.VideoWidget.Controls controls)
| stop (self)
QString | styleSheet (self)
long | totalTime (self)
QString | url (self)
Plasma.VideoWidget.Controls | usedControls (self)

## Signal Documentation

aboutToFinish | ( |  | ) |

Emitted an instant before the playback is finished

Signal syntax:
  `QObject.connect(source, SIGNAL("aboutToFinish()"), target_slot)`

nextRequested | ( |  | ) |

The user pressed the "next" button

Since:
  4.3

Signal syntax:
  `QObject.connect(source, SIGNAL("nextRequested()"), target_slot)`

previousRequested | ( |  | ) |

The user pressed the "previous" button

Since:
  4.3

Signal syntax:
  `QObject.connect(source, SIGNAL("previousRequested()"), target_slot)`

tick | ( | long | time
| ) |  |  |

Emitted regularly when the playing is progressing @arg time where we are

Signal syntax:
  `QObject.connect(source, SIGNAL("tick(qint64)"), target_slot)`

## Method Documentation

__init__ | ( | self, |
|  | QGraphicsWidget | parent=0
| ) |  |  |

bool controlsVisible | ( |  | self ) |

Returns:
  true if the controls widget is being shown right now

long currentTime | ( |  | self ) |

Returns:
  the current time of the current media file

hoverEnterEvent | ( | self, |
|  | QGraphicsSceneHoverEvent | event
| ) |  |  |

hoverLeaveEvent | ( | self, |
|  | QGraphicsSceneHoverEvent | event
| ) |  |  |

hoverMoveEvent | ( | self, |
|  | QGraphicsSceneHoverEvent | event
| ) |  |  |

pause | ( |  | self ) |

Pause the current file

play | ( |  | self ) |

Play the current file

long remainingTime | ( |  | self ) |

Returns:
  the time remaining to the current media file

resizeEvent | ( | self, |
|  | QGraphicsSceneResizeEvent | event
| ) |  |  |

seek | ( | self, |
|  | long | time
| ) |  |  |

Jump at a given millisecond in the current file @arg time where we want to jump

setControlsVisible | ( | self, |
|  | bool | visible
| ) |  |  |

Show/hide the main controls widget, if any of them is used

@arg visible if we want to show or hide the main controls

See also:
  setUsedControls()

setStyleSheet | ( | self, |
|  | QString | stylesheet
| ) |  |  |

Sets the stylesheet used to control the visual display of this VideoWidget

@arg stylesheet a CSS string

setUrl | ( | self, |
|  | QString | url
| ) |  |  |

Load a certain url that can be a local file or a remote one @arg path resource to play

setUsedControls | ( | self, |
|  | Plasma.VideoWidget.Controls | controls
| ) |  |  |

Set what control widgets to use

@arg controls bitwise OR combination of Controls flags

See also:
  Controls

stop | ( |  | self ) |

Stop the current file

QString styleSheet | ( |  | self ) |

Returns:
  the stylesheet currently used with this widget

long totalTime | ( |  | self ) |

Returns:
  the total playing time of the current media file

QString url | ( |  | self ) |

Returns:
  the url (local or remote) we are playing

Plasma.VideoWidget.Controls usedControls | ( |  | self ) |

Returns:
  the video controls that are used and shown

See also:
  Controls

## Enumeration Documentation

Control

Enumerator:

  NoControls = 0 |
  Play = 1 |
  Pause = 2 |
  Stop = 4 |
  PlayPause = 8 |
  Previous = 16 |
  Next = 32 |
  Progress = 64 |
  Volume = 128 |
  OpenFile = 128 |
  DefaultControls = PlayPause|Progress|Volume|OpenFile |