File: phonon-videoplayer.html

package info (click to toggle)
python-qt4 4.7.3-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 28,504 kB
  • ctags: 4,680
  • sloc: python: 28,738; cpp: 8,897; sh: 245; xml: 243; makefile: 150
file content (74 lines) | stat: -rw-r--r-- 13,380 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>Phonon.VideoPlayer Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">Phonon.VideoPlayer Class Reference<br /><sup><sup>[<a href="phonon.html">phonon</a> module]</sup></sup></h1><p>The VideoPlayer widget is used to perform playback of video. <a href="#details">More...</a></p>
<p>Inherits <a href="qwidget.html">QWidget</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="phonon-videoplayer.html#VideoPlayer">__init__</a></b> (<i>self</i>, Category, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="phonon-videoplayer.html#VideoPlayer-2">__init__</a></b> (<i>self</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" />AudioOutput <b><a href="phonon-videoplayer.html#audioOutput">audioOutput</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="phonon-videoplayer.html#currentTime">currentTime</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="phonon-videoplayer.html#isPaused">isPaused</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="phonon-videoplayer.html#isPlaying">isPlaying</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="phonon-videoplayer.html#load">load</a></b> (<i>self</i>, MediaSource)</li><li><div class="fn" />MediaObject <b><a href="phonon-videoplayer.html#mediaObject">mediaObject</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="phonon-videoplayer.html#pause">pause</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="phonon-videoplayer.html#play">play</a></b> (<i>self</i>, MediaSource)</li><li><div class="fn" /><b><a href="phonon-videoplayer.html#play-2">play</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="phonon-videoplayer.html#seek">seek</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="phonon-videoplayer.html#setVolume">setVolume</a></b> (<i>self</i>, float)</li><li><div class="fn" /><b><a href="phonon-videoplayer.html#stop">stop</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="phonon-videoplayer.html#totalTime">totalTime</a></b> (<i>self</i>)</li><li><div class="fn" />VideoWidget <b><a href="phonon-videoplayer.html#videoWidget">videoWidget</a></b> (<i>self</i>)</li><li><div class="fn" />float <b><a href="phonon-videoplayer.html#volume">volume</a></b> (<i>self</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="phonon-videoplayer.html#finished">finished</a></b> ()</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The VideoPlayer widget is used to perform playback of video.</p>
<p>With VideoPlayer you can get results quickly and easily. You can do the standard playback tasks like <a href="phonon-videoplayer.html#play">play</a>(), <a href="phonon-videoplayer.html#pause">pause</a>(), and <a href="phonon-videoplayer.html#stop">stop</a>(), but also set a playback volume and seek - if the media and backend supports seeking.</p>
<p>VideoPlayer is provided for convenience and removes the need to create a media graph with a <a href="phonon-mediaobject.html">MediaObject</a>, <a href="phonon-audiooutput.html">AudioOutput</a>, and <a href="phonon-videowidget.html">VideoWidget</a>. If you need functionality not supported by the player, you can build this <a href="phonon-overview.html#building-graphs">graph</a> yourself.</p>
<p>Keep in mind that when the VideoPlayer instance is deleted the playback will stop.</p>
<p>Note also that most of the functions in this class are asynchronous. For instance, a media source may not play immediately after you call the <a href="phonon-videoplayer.html#play">play</a>() function.</p>
<p>A play and forget code example:</p>
<pre> VideoPlayer *player = new VideoPlayer(Phonon.VideoCategory, parentWidget);
 connect(player, SIGNAL(finished()), player, SLOT(deleteLater()));
 player-&gt;play(url);</pre>
<p>See also <a href="phonon-module.html">Phonon Module</a> and <a href="phonon-mediaobject.html">MediaObject</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="VideoPlayer" />VideoPlayer.__init__ (<i>self</i>, <a href="phonon.html#Category-enum">Category</a>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a new <a href="phonon-videoplayer.html">VideoPlayer</a> instance with the specified <i>parent</i>.</p>
<p><i>category</i> is the category used for the audio output device.</p>
<h3 class="fn"><a name="VideoPlayer-2" />VideoPlayer.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a new video widget with a <i>parent</i> using <a href="phonon.html#Category-enum">Phonon.VideoCategory</a> as its category.</p>
<p><i>parent</i> The <a href="qobject.html">QObject</a> parent.</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/~VideoPlayer" />
<h3 class="fn"><a name="audioOutput" /><a href="phonon-audiooutput.html">AudioOutput</a> VideoPlayer.audioOutput (<i>self</i>)</h3><p>Returns the audio output object being used by the player.</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/currentTime" />
<h3 class="fn"><a name="currentTime" />int VideoPlayer.currentTime (<i>self</i>)</h3><p>Get the current time (in milliseconds) of the file currently being played.</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/finished" />
<h3 class="fn"><a name="isPaused" />bool VideoPlayer.isPaused (<i>self</i>)</h3><p>Returns true if it is currently paused; otherwise returns false if it is currently playing or stopped.</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/isPlaying" />
<h3 class="fn"><a name="isPlaying" />bool VideoPlayer.isPlaying (<i>self</i>)</h3><p>Returns true if it is currently playing; otherwise returns false if it is currently stopped or paused</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/load" />
<h3 class="fn"><a name="load" />VideoPlayer.load (<i>self</i>, <a href="phonon-mediasource.html">MediaSource</a>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void load(const Phonon::MediaSource&amp;)</tt>.</p><p>Starts pre-loading the media data from the specified <i>source</i> and filling audio buffers in the backend.</p>
<p>When there's already a media playing (or paused) it will be stopped (the finished signal will not be emitted).</p>
<p>See also <a href="phonon-mediaobject.html#setCurrentSource">MediaObject.setCurrentSource</a>().</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/mediaObject" />
<h3 class="fn"><a name="mediaObject" /><a href="phonon-mediaobject.html">MediaObject</a> VideoPlayer.mediaObject (<i>self</i>)</h3><p>Returns the media object being used by the player.</p>
<p>The media object can be accessed directly instead of using the <a href="phonon-videoplayer.html">VideoPlayer</a>s convenience functions, e.g., <a href="phonon-videoplayer.html#play">play</a>() and <a href="phonon-videoplayer.html#stop">stop</a>(). It is also possible to give the object to other Phonon widgets, e.g., a <a href="phonon-seekslider.html">SeekSlider</a> or a <a href="phonon-volumeslider.html">VolumeSlider</a>.</p>
<p>See also <a href="phonon-seekslider.html">Phonon.SeekSlider</a> and <a href="phonon-mediaobject.html">Phonon.MediaObject</a>.</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/pause" />
<h3 class="fn"><a name="pause" />VideoPlayer.pause (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void pause()</tt>.</p><p>Pauses the playback.</p>
<p>See also <a href="phonon-mediaobject.html#pause">MediaObject.pause</a>().</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/play" />
<h3 class="fn"><a name="play" />VideoPlayer.play (<i>self</i>, <a href="phonon-mediasource.html">MediaSource</a>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void play(const Phonon::MediaSource&amp;)</tt>.</p><p>Plays the media from the given <i>source</i>. Starts playback as fast as possible. This can take a considerable time depending on the URL and the backend.</p>
<p>If you need low latency between calling play() and the sound actually starting to play on your output device you need to use <a href="phonon-mediaobject.html">MediaObject</a> and be able to set the URL before calling play(). Note that</p>
<pre> audioPlayer-&gt;load(url);
 audioPlayer-&gt;play();</pre>
<p>doesn't make a difference: the application should be idle between the load and play calls so that the backend can start preloading the media and fill audio buffers.</p>
<h3 class="fn"><a name="play-2" />VideoPlayer.play (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void play()</tt>.</p><p>Continues playback of paused media. Restarts playback of a stopped (or newly loaded) media.</p>
<p>See also <a href="phonon-mediaobject.html#play">MediaObject.play</a>() and <a href="phonon-videoplayer.html#play">play</a>().</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/seek" />
<h3 class="fn"><a name="seek" />VideoPlayer.seek (<i>self</i>, int)</h3><p>This method is also a Qt slot with the C++ signature <tt>void seek(qint64)</tt>.</p><p>Seeks to the requested time. Note that the backend is free to ignore the seek request if the media source isn't seekable; you can check this by asking the media object of the <a href="phonon-videoplayer.html">VideoPlayer</a>.</p>
<pre>     player-&gt;mediaObject()-&gt;isSeekable();</pre>
<p>The <i>ms</i> parameter is the time in milliseconds from the start of the media.</p>
<p>The call is asynchronous, so <a href="phonon-videoplayer.html#currentTime">currentTime</a>() can still be the old value right after this method was called. If all you need is a slider that shows the current position and allows the user to seek, use the class <a href="phonon-seekslider.html">SeekSlider</a>.</p>
<p>See also <a href="phonon-mediaobject.html#seek">MediaObject.seek</a>(), <a href="phonon-mediaobject.html#isSeekable">MediaObject.isSeekable</a>(), and <a href="phonon-videoplayer.html#mediaObject">mediaObject</a>().</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/setVolume" />
<h3 class="fn"><a name="setVolume" />VideoPlayer.setVolume (<i>self</i>, float)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setVolume(float)</tt>.</p><p>Sets the <i>volume</i> of the output as voltage factor.</p>
<p>1.0 means 100%, 0.5 means 50% voltage/25% power, 0.0 means 0%</p>
<p>See also <a href="phonon-videoplayer.html#volume">volume</a>().</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/stop" />
<h3 class="fn"><a name="stop" />VideoPlayer.stop (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void stop()</tt>.</p><p>Stops the playback.</p>
<p>See also <a href="phonon-mediaobject.html#stop">MediaObject.stop</a>().</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/totalTime" />
<h3 class="fn"><a name="totalTime" />int VideoPlayer.totalTime (<i>self</i>)</h3><p>Get the total time (in milliseconds) of the file currently being played.</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/videoWidget" />
<h3 class="fn"><a name="videoWidget" /><a href="phonon-videowidget.html">VideoWidget</a> VideoPlayer.videoWidget (<i>self</i>)</h3><p>Returns the video widget being used by the player.</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/volume" />
<h3 class="fn"><a name="volume" />float VideoPlayer.volume (<i>self</i>)</h3><p>This is the current volume of the output as voltage factor.</p>
<p>1.0 means 100%, 0.5 means 50% voltage/25% power, 0.0 means 0%</p>
<p>See also <a href="phonon-videoplayer.html#setVolume">setVolume</a>().</p>
<p /><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="finished" />void finished ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when the playback finished.</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/isPaused" />
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.2</td></tr></table></div></address></body></html>