Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-updates > by-pkgid > 1680fb88efc4e76ac8cb0ebf3578014f > files > 209

qtmultimedia5-doc-5.12.6-1.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qmediaplayer.cpp -->
  <title>QMediaPlayer Class | Qt Multimedia 5.12.6</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qtmultimedia-index.html">Qt Multimedia</a></td><td ><a href="qtmultimedia-modules.html">C++ Classes</a></td><td >QMediaPlayer</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtmultimedia-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-types">Public Types</a></li>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#reimplemented-public-functions">Reimplemented Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QMediaPlayer Class</h1>
<!-- $$$QMediaPlayer-brief -->
<p>The <a href="qmediaplayer.html">QMediaPlayer</a> class allows the playing of a media source. <a href="#details">More...</a></p>
<!-- @@@QMediaPlayer -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QMediaPlayer&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += multimedia</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <a href="qmediaobject.html">QMediaObject</a></td></tr></table></div><ul>
<li><a href="qmediaplayer-members.html">List of all members, including inherited members</a></li>
<li><a href="qmediaplayer-obsolete.html">Obsolete members</a></li>
</ul>
<a name="public-types"></a>
<h2 id="public-types">Public Types</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#Error-enum">Error</a></b> { NoError, ResourceError, FormatError, NetworkError, AccessDeniedError, ServiceMissingError }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#Flag-enum">Flag</a></b> { LowLatency, StreamPlayback, VideoSurface }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> flags </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#Flag-enum">Flags</a></b></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#MediaStatus-enum">MediaStatus</a></b> { UnknownMediaStatus, NoMedia, LoadingMedia, LoadedMedia, ..., InvalidMedia }</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#State-enum">State</a></b> { StoppedState, PlayingState, PausedState }</td></tr>
</table></div>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<div class="table"><table class="propsummary">
<tr><td class="topAlign"><ul>
<li class="fn"><b><a href="qmediaplayer.html#audioAvailable-prop">audioAvailable</a></b> : const bool</li>
<li class="fn"><b><a href="qmediaplayer.html#audioRole-prop">audioRole</a></b> : QAudio::Role</li>
<li class="fn"><b><a href="qmediaplayer.html#bufferStatus-prop">bufferStatus</a></b> : const int</li>
<li class="fn"><b><a href="qmediaplayer.html#currentMedia-prop">currentMedia</a></b> : const QMediaContent</li>
<li class="fn"><b><a href="qmediaplayer.html#customAudioRole-prop">customAudioRole</a></b> : QString</li>
<li class="fn"><b><a href="qmediaplayer.html#duration-prop">duration</a></b> : const qint64</li>
<li class="fn"><b><a href="qmediaplayer.html#error-prop">error</a></b> : const QString</li>
<li class="fn"><b><a href="qmediaplayer.html#media-prop">media</a></b> : QMediaContent</li>
<li class="fn"><b><a href="qmediaplayer.html#mediaStatus-prop">mediaStatus</a></b> : const MediaStatus</li>
</ul></td><td class="topAlign"><ul>
<li class="fn"><b><a href="qmediaplayer.html#muted-prop">muted</a></b> : bool</li>
<li class="fn"><b><a href="qmediaplayer.html#playbackRate-prop">playbackRate</a></b> : qreal</li>
<li class="fn"><b><a href="qmediaplayer.html#playlist-prop">playlist</a></b> : QMediaPlaylist*</li>
<li class="fn"><b><a href="qmediaplayer.html#position-prop">position</a></b> : qint64</li>
<li class="fn"><b><a href="qmediaplayer.html#seekable-prop">seekable</a></b> : const bool</li>
<li class="fn"><b><a href="qmediaplayer.html#state-prop">state</a></b> : const State</li>
<li class="fn"><b><a href="qmediaplayer.html#videoAvailable-prop">videoAvailable</a></b> : const bool</li>
<li class="fn"><b><a href="qmediaplayer.html#volume-prop">volume</a></b> : int</li>
</ul>
</td></tr>
</table></div>
<ul>
<li class="fn">1 property inherited from <a href="qmediaobject.html#properties">QMediaObject</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#QMediaPlayer">QMediaPlayer</a></b>(QObject *<i>parent</i> = nullptr, QMediaPlayer::Flags <i>flags</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#dtor.QMediaPlayer">~QMediaPlayer</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAudio::Role </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#audioRole-prop">audioRole</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#bufferStatus-prop">bufferStatus</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMediaContent </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#currentMedia-prop">currentMedia</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QNetworkConfiguration </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#currentNetworkConfiguration">currentNetworkConfiguration</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#customAudioRole-prop">customAudioRole</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qint64 </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#duration-prop">duration</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMediaPlayer::Error </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#error">error</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#error-prop">errorString</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#audioAvailable-prop">isAudioAvailable</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#muted-prop">isMuted</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#seekable-prop">isSeekable</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#videoAvailable-prop">isVideoAvailable</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMediaContent </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#media-prop">media</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMediaPlayer::MediaStatus </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#mediaStatus-prop">mediaStatus</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QIODevice *</td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#mediaStream">mediaStream</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#playbackRate-prop">playbackRate</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMediaPlaylist *</td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#playlist-prop">playlist</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qint64 </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#position-prop">position</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#audioRole-prop">setAudioRole</a></b>(QAudio::Role <i>audioRole</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#customAudioRole-prop">setCustomAudioRole</a></b>(const QString &amp;<i>audioRole</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#setVideoOutput">setVideoOutput</a></b>(QVideoWidget *<i>output</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#setVideoOutput-1">setVideoOutput</a></b>(QGraphicsVideoItem *<i>output</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#setVideoOutput-2">setVideoOutput</a></b>(QAbstractVideoSurface *<i>surface</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMediaPlayer::State </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#state-prop">state</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QList&lt;QAudio::Role&gt; </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#supportedAudioRoles">supportedAudioRoles</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QStringList </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#supportedCustomAudioRoles">supportedCustomAudioRoles</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#volume-prop">volume</a></b>() const</td></tr>
</table></div>
<a name="reimplemented-public-functions"></a>
<h2 id="reimplemented-public-functions">Reimplemented Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual QMultimedia::AvailabilityStatus </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#availability">availability</a></b>() const override</td></tr>
</table></div>
<ul>
<li class="fn">10 public functions inherited from <a href="qmediaobject.html#public-functions">QMediaObject</a></li>
</ul>
<a name="public-slots"></a>
<h2 id="public-slots">Public Slots</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#pause">pause</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#play">play</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#setMedia">setMedia</a></b>(const QMediaContent &amp;<i>media</i>, QIODevice *<i>stream</i> = nullptr)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#muted-prop">setMuted</a></b>(bool <i>muted</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#setNetworkConfigurations">setNetworkConfigurations</a></b>(const QList&lt;QNetworkConfiguration&gt; &amp;<i>configurations</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#playbackRate-prop">setPlaybackRate</a></b>(qreal <i>rate</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#playlist-prop">setPlaylist</a></b>(QMediaPlaylist *<i>playlist</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#position-prop">setPosition</a></b>(qint64 <i>position</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#volume-prop">setVolume</a></b>(int <i>volume</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#stop">stop</a></b>()</td></tr>
</table></div>
<a name="signals"></a>
<h2 id="signals">Signals</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#audioAvailableChanged">audioAvailableChanged</a></b>(bool <i>available</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#audioRoleChanged">audioRoleChanged</a></b>(QAudio::Role <i>role</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#bufferStatusChanged">bufferStatusChanged</a></b>(int <i>percentFilled</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#currentMediaChanged">currentMediaChanged</a></b>(const QMediaContent &amp;<i>media</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#customAudioRoleChanged">customAudioRoleChanged</a></b>(const QString &amp;<i>role</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#durationChanged">durationChanged</a></b>(qint64 <i>duration</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#error-1">error</a></b>(QMediaPlayer::Error <i>error</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#mediaChanged">mediaChanged</a></b>(const QMediaContent &amp;<i>media</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#mediaStatusChanged">mediaStatusChanged</a></b>(QMediaPlayer::MediaStatus <i>status</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#mutedChanged">mutedChanged</a></b>(bool <i>muted</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#networkConfigurationChanged">networkConfigurationChanged</a></b>(const QNetworkConfiguration &amp;<i>configuration</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#playbackRateChanged">playbackRateChanged</a></b>(qreal <i>rate</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#positionChanged">positionChanged</a></b>(qint64 <i>position</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#seekableChanged">seekableChanged</a></b>(bool <i>seekable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#stateChanged">stateChanged</a></b>(QMediaPlayer::State <i>state</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#videoAvailableChanged">videoAvailableChanged</a></b>(bool <i>videoAvailable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#volumeChanged">volumeChanged</a></b>(int <i>volume</i>)</td></tr>
</table></div>
<ul>
<li class="fn">6 signals inherited from <a href="qmediaobject.html#signals">QMediaObject</a></li>
</ul>
<a name="static-public-members"></a>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QMultimedia::SupportEstimate </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#hasSupport">hasSupport</a></b>(const QString &amp;<i>mimeType</i>, const QStringList &amp;<i>codecs</i> = QStringList(), QMediaPlayer::Flags <i>flags</i> = ...)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QMetaObject </td><td class="memItemRight bottomAlign"><b><a href="qmediaplayer.html#staticMetaObject-var">staticMetaObject</a></b></td></tr>
</table></div>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">2 protected functions inherited from <a href="qmediaobject.html#protected-functions">QMediaObject</a></li>
</ul>
<a name="details"></a>
<!-- $$$QMediaPlayer-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qmediaplayer.html">QMediaPlayer</a> class allows the playing of a media source.</p>
<p>The <a href="qmediaplayer.html">QMediaPlayer</a> class is a high level media playback class. It can be used to playback such content as songs, movies and internet radio. The content to playback is specified as a <a href="qmediacontent.html">QMediaContent</a> object, which can be thought of as a main or canonical URL with additional information attached. When provided with a <a href="qmediacontent.html">QMediaContent</a> playback may be able to commence.</p>
<pre class="cpp">

  player <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qmediaplayer.html#QMediaPlayer">QMediaPlayer</a></span>;
  connect(player<span class="operator">,</span> SIGNAL(positionChanged(<span class="type">qint64</span>))<span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> SLOT(positionChanged(<span class="type">qint64</span>)));
  player<span class="operator">-</span><span class="operator">&gt;</span>setMedia(<span class="type">QUrl</span><span class="operator">::</span>fromLocalFile(<span class="string">&quot;/Users/me/Music/coolsong.mp3&quot;</span>));
  player<span class="operator">-</span><span class="operator">&gt;</span>setVolume(<span class="number">50</span>);
  player<span class="operator">-</span><span class="operator">&gt;</span>play();

</pre>
<p><a href="qvideowidget.html">QVideoWidget</a> can be used with <a href="qmediaplayer.html">QMediaPlayer</a> for video rendering and <a href="qmediaplaylist.html">QMediaPlaylist</a> for accessing playlist functionality.</p>
<pre class="cpp">

  playlist <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qmediaplaylist.html">QMediaPlaylist</a></span>;
  playlist<span class="operator">-</span><span class="operator">&gt;</span>addMedia(<span class="type">QUrl</span>(<span class="string">&quot;http://example.com/movie1.mp4&quot;</span>));
  playlist<span class="operator">-</span><span class="operator">&gt;</span>addMedia(<span class="type">QUrl</span>(<span class="string">&quot;http://example.com/movie2.mp4&quot;</span>));
  playlist<span class="operator">-</span><span class="operator">&gt;</span>addMedia(<span class="type">QUrl</span>(<span class="string">&quot;http://example.com/movie3.mp4&quot;</span>));
  playlist<span class="operator">-</span><span class="operator">&gt;</span>setCurrentIndex(<span class="number">1</span>);

  player <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qmediaplayer.html#QMediaPlayer">QMediaPlayer</a></span>;
  player<span class="operator">-</span><span class="operator">&gt;</span>setPlaylist(playlist);

  videoWidget <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qvideowidget.html">QVideoWidget</a></span>;
  player<span class="operator">-</span><span class="operator">&gt;</span>setVideoOutput(videoWidget);
  videoWidget<span class="operator">-</span><span class="operator">&gt;</span>show();

  player<span class="operator">-</span><span class="operator">&gt;</span>play();

</pre>
<p>Since <a href="qmediaplayer.html">QMediaPlayer</a> is a <a href="qmediaobject.html">QMediaObject</a>, you can use several of the <a href="qmediaobject.html">QMediaObject</a> functions for things like:</p>
<ul>
<li>Accessing the currently playing media's metadata (<a href="qmediaobject.html#metaData">QMediaObject::metaData</a>() and <a href="qmediametadata.html">predefined meta-data keys</a>)</li>
<li>Checking to see if the media playback service is currently available (<a href="qmediaobject.html#availability">QMediaObject::availability</a>())</li>
</ul>
</div>
<p><b>See also </b><a href="qmediaobject.html">QMediaObject</a>, <a href="qmediaservice.html">QMediaService</a>, <a href="qvideowidget.html">QVideoWidget</a>, and <a href="qmediaplaylist.html">QMediaPlaylist</a>.</p>
<!-- @@@QMediaPlayer -->
<div class="types">
<h2>Member Type Documentation</h2>
<!-- $$$Error$$$NoError$$$ResourceError$$$FormatError$$$NetworkError$$$AccessDeniedError$$$ServiceMissingError$$$MediaIsPlaylist -->
<h3 class="fn" id="Error-enum"><a name="Error-enum"></a>enum QMediaPlayer::<span class="name">Error</span></h3>
<p>Defines a media player error condition.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QMediaPlayer::NoError</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">No error has occurred.</td></tr>
<tr><td class="topAlign"><code>QMediaPlayer::ResourceError</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">A media resource couldn't be resolved.</td></tr>
<tr><td class="topAlign"><code>QMediaPlayer::FormatError</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">The format of a media resource isn't (fully) supported. Playback may still be possible, but without an audio or video component.</td></tr>
<tr><td class="topAlign"><code>QMediaPlayer::NetworkError</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">A network error occurred.</td></tr>
<tr><td class="topAlign"><code>QMediaPlayer::AccessDeniedError</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">There are not the appropriate permissions to play a media resource.</td></tr>
<tr><td class="topAlign"><code>QMediaPlayer::ServiceMissingError</code></td><td class="topAlign tblval"><code>5</code></td><td class="topAlign">A valid playback service was not found, playback cannot proceed.</td></tr>
</table></div>
<!-- @@@Error -->
<!-- $$$Flag$$$LowLatency$$$StreamPlayback$$$VideoSurface -->
<h3 class="flags" id="Flag-enum"><a name="Flag-enum"></a>enum QMediaPlayer::<span class="name">Flag</span><br/>flags QMediaPlayer::<span class="name">Flags</span></h3>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QMediaPlayer::LowLatency</code></td><td class="topAlign tblval"><code>0x01</code></td><td class="topAlign">The player is expected to be used with simple audio formats, but playback should start without significant delay. Such playback service can be used for beeps, ringtones, etc.</td></tr>
<tr><td class="topAlign"><code>QMediaPlayer::StreamPlayback</code></td><td class="topAlign tblval"><code>0x02</code></td><td class="topAlign">The player is expected to play QIODevice based streams. If passed to <a href="qmediaplayer.html">QMediaPlayer</a> constructor, the service supporting streams playback will be chosen.</td></tr>
<tr><td class="topAlign"><code>QMediaPlayer::VideoSurface</code></td><td class="topAlign tblval"><code>0x04</code></td><td class="topAlign">The player is expected to be able to render to a <a href="qabstractvideosurface.html">QAbstractVideoSurface</a> <a href="qmediaplayer.html#setVideoOutput">output</a>.</td></tr>
</table></div>
<p>The Flags type is a typedef for <a href="">QFlags</a>&lt;Flag&gt;. It stores an OR combination of Flag values.</p>
<!-- @@@Flag -->
<!-- $$$MediaStatus$$$UnknownMediaStatus$$$NoMedia$$$LoadingMedia$$$LoadedMedia$$$StalledMedia$$$BufferingMedia$$$BufferedMedia$$$EndOfMedia$$$InvalidMedia -->
<h3 class="fn" id="MediaStatus-enum"><a name="MediaStatus-enum"></a>enum QMediaPlayer::<span class="name">MediaStatus</span></h3>
<p>Defines the status of a media player's current media.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QMediaPlayer::UnknownMediaStatus</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The status of the media cannot be determined.</td></tr>
<tr><td class="topAlign"><code>QMediaPlayer::NoMedia</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The is no current media. The player is in the <a href="qmediaplayer.html#State-enum">StoppedState</a>.</td></tr>
<tr><td class="topAlign"><code>QMediaPlayer::LoadingMedia</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">The current media is being loaded. The player may be in any state.</td></tr>
<tr><td class="topAlign"><code>QMediaPlayer::LoadedMedia</code></td><td class="topAlign tblval"><code>3</code></td><td class="topAlign">The current media has been loaded. The player is in the <a href="qmediaplayer.html#State-enum">StoppedState</a>.</td></tr>
<tr><td class="topAlign"><code>QMediaPlayer::StalledMedia</code></td><td class="topAlign tblval"><code>4</code></td><td class="topAlign">Playback of the current media has stalled due to insufficient buffering or some other temporary interruption. The player is in the <a href="qmediaplayer.html#State-enum">PlayingState</a> or <a href="qmediaplayer.html#State-enum">PausedState</a>.</td></tr>
<tr><td class="topAlign"><code>QMediaPlayer::BufferingMedia</code></td><td class="topAlign tblval"><code>5</code></td><td class="topAlign">The player is buffering data but has enough data buffered for playback to continue for the immediate future. The player is in the <a href="qmediaplayer.html#State-enum">PlayingState</a> or <a href="qmediaplayer.html#State-enum">PausedState</a>.</td></tr>
<tr><td class="topAlign"><code>QMediaPlayer::BufferedMedia</code></td><td class="topAlign tblval"><code>6</code></td><td class="topAlign">The player has fully buffered the current media. The player is in the <a href="qmediaplayer.html#State-enum">PlayingState</a> or <a href="qmediaplayer.html#State-enum">PausedState</a>.</td></tr>
<tr><td class="topAlign"><code>QMediaPlayer::EndOfMedia</code></td><td class="topAlign tblval"><code>7</code></td><td class="topAlign">Playback has reached the end of the current media. The player is in the <a href="qmediaplayer.html#State-enum">StoppedState</a>.</td></tr>
<tr><td class="topAlign"><code>QMediaPlayer::InvalidMedia</code></td><td class="topAlign tblval"><code>8</code></td><td class="topAlign">The current media cannot be played. The player is in the <a href="qmediaplayer.html#State-enum">StoppedState</a>.</td></tr>
</table></div>
<!-- @@@MediaStatus -->
<!-- $$$State$$$StoppedState$$$PlayingState$$$PausedState -->
<h3 class="fn" id="State-enum"><a name="State-enum"></a>enum QMediaPlayer::<span class="name">State</span></h3>
<p>Defines the current state of a media player.</p>
<div class="table"><table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr>
<tr><td class="topAlign"><code>QMediaPlayer::StoppedState</code></td><td class="topAlign tblval"><code>0</code></td><td class="topAlign">The media player is not playing content, playback will begin from the start of the current track.</td></tr>
<tr><td class="topAlign"><code>QMediaPlayer::PlayingState</code></td><td class="topAlign tblval"><code>1</code></td><td class="topAlign">The media player is currently playing content.</td></tr>
<tr><td class="topAlign"><code>QMediaPlayer::PausedState</code></td><td class="topAlign tblval"><code>2</code></td><td class="topAlign">The media player has paused playback, playback of the current track will resume from the position the player was paused at.</td></tr>
</table></div>
<!-- @@@State -->
</div>
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$audioAvailable-prop$$$isAudioAvailable$$$audioAvailableChangedbool -->
<h3 class="fn" id="audioAvailable-prop"><a name="audioAvailable-prop"></a><span class="name">audioAvailable</span> : const <span class="type">bool</span></h3>
<p>This property holds the audio availabilty status for the current media.</p>
<p>As the life time of <a href="qmediaplayer.html">QMediaPlayer</a> can be longer than the playback of one <a href="qmediacontent.html">QMediaContent</a>, this property may change over time, the <a href="qmediaplayer.html#audioAvailableChanged">audioAvailableChanged</a> signal can be used to monitor it's status.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isAudioAvailable</b></span>() const</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qmediaplayer.html#audioAvailableChanged">audioAvailableChanged</a></b></span>(bool <i>available</i>)</td></tr>
</table></div>
<!-- @@@audioAvailable -->
<!-- $$$audioRole-prop$$$audioRole$$$setAudioRoleQAudio::Role$$$audioRoleChangedQAudio::Role -->
<h3 class="fn" id="audioRole-prop"><a name="audioRole-prop"></a><span class="name">audioRole</span> : <span class="type"><a href="qaudio.html#Role-enum">QAudio::Role</a></span></h3>
<p>This property holds the role of the audio stream played by the media player.</p>
<p>It can be set to specify the type of audio being played, allowing the system to make appropriate decisions when it comes to volume, routing or post-processing.</p>
<p>The audio role must be set before calling <a href="qmediaplayer.html#setMedia">setMedia</a>().</p>
<p><a href="qmediaplayer.html#customAudioRole-prop">customAudioRole</a> is cleared when this property is set to anything other than <a href="qaudio.html#Role-enum">QAudio::CustomRole</a>.</p>
<p>This property was introduced in  Qt 5.6.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QAudio::Role </td><td class="memItemRight bottomAlign"><span class="name"><b>audioRole</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setAudioRole</b></span>(QAudio::Role <i>audioRole</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qmediaplayer.html#audioRoleChanged">audioRoleChanged</a></b></span>(QAudio::Role <i>role</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qmediaplayer.html#supportedAudioRoles">supportedAudioRoles</a>().</p>
<!-- @@@audioRole -->
<!-- $$$bufferStatus-prop$$$bufferStatus$$$bufferStatusChangedint -->
<h3 class="fn" id="bufferStatus-prop"><a name="bufferStatus-prop"></a><span class="name">bufferStatus</span> : const <span class="type">int</span></h3>
<p>This property holds the percentage of the temporary buffer filled before playback begins or resumes, from <code>0</code> (empty) to <code>100</code> (full).</p>
<p>When the player object is buffering; this property holds the percentage of the temporary buffer that is filled. The buffer will need to reach 100% filled before playback can start or resume, at which time <a href="qmediaplayer.html#mediaStatus-prop">mediaStatus</a>() will return <a href="qmediaplayer.html#MediaStatus-enum">BufferedMedia</a> or <a href="qmediaplayer.html#MediaStatus-enum">BufferingMedia</a>. If the value is anything lower than <code>100</code>, <a href="qmediaplayer.html#mediaStatus-prop">mediaStatus</a>() will return <a href="qmediaplayer.html#MediaStatus-enum">StalledMedia</a>.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>bufferStatus</b></span>() const</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qmediaplayer.html#bufferStatusChanged">bufferStatusChanged</a></b></span>(int <i>percentFilled</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qmediaplayer.html#mediaStatus-prop">mediaStatus</a>().</p>
<!-- @@@bufferStatus -->
<!-- $$$currentMedia-prop$$$currentMedia$$$currentMediaChangedconstQMediaContent& -->
<h3 class="fn" id="currentMedia-prop"><a name="currentMedia-prop"></a><span class="name">currentMedia</span> : const <span class="type"><a href="qmediacontent.html">QMediaContent</a></span></h3>
<p>This property holds the current active media content being played by the player object. This value could be different from <a href="qmediaplayer.html#media-prop">QMediaPlayer::media</a> property if a playlist is used. In this case currentMedia indicates the current media content being processed by the player, while <a href="qmediaplayer.html#media-prop">QMediaPlayer::media</a> property contains the original playlist.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QMediaContent </td><td class="memItemRight bottomAlign"><span class="name"><b>currentMedia</b></span>() const</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qmediaplayer.html#currentMediaChanged">currentMediaChanged</a></b></span>(const QMediaContent &amp;<i>media</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qmediacontent.html">QMediaContent</a> and <a href="qmediaplayer.html#media-prop">media</a>().</p>
<!-- @@@currentMedia -->
<!-- $$$customAudioRole-prop$$$customAudioRole$$$setCustomAudioRoleconstQString&$$$customAudioRoleChangedconstQString& -->
<h3 class="fn" id="customAudioRole-prop"><a name="customAudioRole-prop"></a><span class="name">customAudioRole</span> : <span class="type">QString</span></h3>
<p>This property holds the role of the audio stream played by the media player.</p>
<p>It can be set to specify the type of audio being played when the backend supports audio roles unknown to Qt. Specifying a role allows the system to make appropriate decisions when it comes to volume, routing or post-processing.</p>
<p>The audio role must be set before calling <a href="qmediaplayer.html#setMedia">setMedia</a>().</p>
<p><a href="qmediaplayer.html#audioRole-prop">audioRole</a> is set to <a href="qaudio.html#Role-enum">QAudio::CustomRole</a> when this property is set.</p>
<p>This property was introduced in  Qt 5.11.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>customAudioRole</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setCustomAudioRole</b></span>(const QString &amp;<i>audioRole</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qmediaplayer.html#customAudioRoleChanged">customAudioRoleChanged</a></b></span>(const QString &amp;<i>role</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qmediaplayer.html#supportedCustomAudioRoles">supportedCustomAudioRoles</a>().</p>
<!-- @@@customAudioRole -->
<!-- $$$duration-prop$$$duration$$$durationChangedqint64 -->
<h3 class="fn" id="duration-prop"><a name="duration-prop"></a><span class="name">duration</span> : const <span class="type">qint64</span></h3>
<p>This property holds the duration of the current media.</p>
<p>The value is the total playback time in milliseconds of the current media. The value may change across the life time of the <a href="qmediaplayer.html">QMediaPlayer</a> object and may not be available when initial playback begins, connect to the <a href="qmediaplayer.html#durationChanged">durationChanged</a>() signal to receive status notifications.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> qint64 </td><td class="memItemRight bottomAlign"><span class="name"><b>duration</b></span>() const</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qmediaplayer.html#durationChanged">durationChanged</a></b></span>(qint64 <i>duration</i>)</td></tr>
</table></div>
<!-- @@@duration -->
<!-- $$$error-prop$$$errorString -->
<h3 class="fn" id="error-prop"><a name="error-prop"></a><span class="name">error</span> : const <span class="type">QString</span></h3>
<p>This property holds a string describing the last error condition.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QString </td><td class="memItemRight bottomAlign"><span class="name"><b>errorString</b></span>() const</td></tr>
</table></div>
<p><b>See also </b><a href="qmediaplayer.html#error">error</a>().</p>
<!-- @@@error -->
<!-- $$$media-prop$$$media$$$setMediaconstQMediaContent&QIODevice*$$$mediaChangedconstQMediaContent& -->
<h3 class="fn" id="media-prop"><a name="media-prop"></a><span class="name">media</span> : <span class="type"><a href="qmediacontent.html">QMediaContent</a></span></h3>
<p>This property holds the active media source being used by the player object.</p>
<p>The player object will use the <a href="qmediacontent.html">QMediaContent</a> for selection of the content to be played.</p>
<p>By default this property has a null <a href="qmediacontent.html">QMediaContent</a>.</p>
<p>Setting this property to a null <a href="qmediacontent.html">QMediaContent</a> will cause the player to discard all information relating to the current media source and to cease all I/O operations related to that media.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QMediaContent </td><td class="memItemRight bottomAlign"><span class="name"><b>media</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qmediaplayer.html#setMedia">setMedia</a></b></span>(const QMediaContent &amp;<i>media</i>, QIODevice *<i>stream</i> = nullptr)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qmediaplayer.html#mediaChanged">mediaChanged</a></b></span>(const QMediaContent &amp;<i>media</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qmediacontent.html">QMediaContent</a> and <a href="qmediaplayer.html#currentMedia-prop">currentMedia</a>().</p>
<!-- @@@media -->
<!-- $$$mediaStatus-prop$$$mediaStatus$$$mediaStatusChangedQMediaPlayer::MediaStatus -->
<h3 class="fn" id="mediaStatus-prop"><a name="mediaStatus-prop"></a><span class="name">mediaStatus</span> : const <span class="type"><a href="qmediaplayer.html#MediaStatus-enum">MediaStatus</a></span></h3>
<p>This property holds the status of the current media stream.</p>
<p>The stream status describes how the playback of the current stream is progressing.</p>
<p>By default this property is <a href="qmediaplayer.html#MediaStatus-enum">QMediaPlayer::NoMedia</a></p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QMediaPlayer::MediaStatus </td><td class="memItemRight bottomAlign"><span class="name"><b>mediaStatus</b></span>() const</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qmediaplayer.html#mediaStatusChanged">mediaStatusChanged</a></b></span>(QMediaPlayer::MediaStatus <i>status</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qmediaplayer.html#state-prop">state</a>.</p>
<!-- @@@mediaStatus -->
<!-- $$$muted-prop$$$isMuted$$$setMutedbool$$$mutedChangedbool -->
<h3 class="fn" id="muted-prop"><a name="muted-prop"></a><span class="name">muted</span> : <span class="type">bool</span></h3>
<p>This property holds the muted state of the current media.</p>
<p>The value will be true if the playback volume is muted; otherwise false.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isMuted</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setMuted</b></span>(bool <i>muted</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qmediaplayer.html#mutedChanged">mutedChanged</a></b></span>(bool <i>muted</i>)</td></tr>
</table></div>
<!-- @@@muted -->
<!-- $$$playbackRate-prop$$$playbackRate$$$setPlaybackRateqreal$$$playbackRateChangedqreal -->
<h3 class="fn" id="playbackRate-prop"><a name="playbackRate-prop"></a><span class="name">playbackRate</span> : <span class="type">qreal</span></h3>
<p>This property holds the playback rate of the current media.</p>
<p>This value is a multiplier applied to the media's standard play rate. By default this value is 1.0, indicating that the media is playing at the standard pace. Values higher than 1.0 will increase the rate of play. Values less than zero can be set and indicate the media will rewind at the multiplier of the standard pace.</p>
<p>Not all playback services support change of the playback rate. It is framework defined as to the status and quality of audio and video while fast forwarding or rewinding.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> qreal </td><td class="memItemRight bottomAlign"><span class="name"><b>playbackRate</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setPlaybackRate</b></span>(qreal <i>rate</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qmediaplayer.html#playbackRateChanged">playbackRateChanged</a></b></span>(qreal <i>rate</i>)</td></tr>
</table></div>
<!-- @@@playbackRate -->
<!-- $$$playlist-prop$$$playlist$$$setPlaylistQMediaPlaylist* -->
<h3 class="fn" id="playlist-prop"><a name="playlist-prop"></a><span class="name">playlist</span> : <span class="type"><a href="qmediaplaylist.html">QMediaPlaylist</a></span>*</h3>
<p>This property holds the media playlist being used by the player object.</p>
<p>The player object will use the current playlist item for selection of the content to be played.</p>
<p>By default this property is set to null.</p>
<p>If the media playlist is used as a source, <a href="qmediaplayer.html#currentMedia-prop">QMediaPlayer::currentMedia</a> is updated with a current playlist item. The current source should be selected with <a href="qmediaplaylist.html#setCurrentIndex">QMediaPlaylist::setCurrentIndex</a>(int) instead of <a href="qmediaplayer.html#setMedia">QMediaPlayer::setMedia</a>(), otherwise the current playlist will be discarded.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QMediaPlaylist *</td><td class="memItemRight bottomAlign"><span class="name"><b>playlist</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setPlaylist</b></span>(QMediaPlaylist *<i>playlist</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qmediacontent.html">QMediaContent</a>.</p>
<!-- @@@playlist -->
<!-- $$$position-prop$$$position$$$setPositionqint64$$$positionChangedqint64 -->
<h3 class="fn" id="position-prop"><a name="position-prop"></a><span class="name">position</span> : <span class="type">qint64</span></h3>
<p>This property holds the playback position of the current media.</p>
<p>The value is the current playback position, expressed in milliseconds since the beginning of the media. Periodically changes in the position will be indicated with the signal <a href="qmediaplayer.html#positionChanged">positionChanged</a>(), the interval between updates can be set with <a href="qmediaobject.html">QMediaObject</a>'s method <a href="qmediaobject.html#notifyInterval-prop">setNotifyInterval</a>().</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> qint64 </td><td class="memItemRight bottomAlign"><span class="name"><b>position</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setPosition</b></span>(qint64 <i>position</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qmediaplayer.html#positionChanged">positionChanged</a></b></span>(qint64 <i>position</i>)</td></tr>
</table></div>
<!-- @@@position -->
<!-- $$$seekable-prop$$$isSeekable$$$seekableChangedbool -->
<h3 class="fn" id="seekable-prop"><a name="seekable-prop"></a><span class="name">seekable</span> : const <span class="type">bool</span></h3>
<p>This property holds the seek-able status of the current media</p>
<p>If seeking is supported this property will be true; false otherwise. The status of this property may change across the life time of the <a href="qmediaplayer.html">QMediaPlayer</a> object, use the <a href="qmediaplayer.html#seekableChanged">seekableChanged</a> signal to monitor changes.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isSeekable</b></span>() const</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qmediaplayer.html#seekableChanged">seekableChanged</a></b></span>(bool <i>seekable</i>)</td></tr>
</table></div>
<!-- @@@seekable -->
<!-- $$$state-prop$$$state$$$stateChangedQMediaPlayer::State -->
<h3 class="fn" id="state-prop"><a name="state-prop"></a><span class="name">state</span> : const <span class="type"><a href="qmediaplayer.html#State-enum">State</a></span></h3>
<p>This property holds the media player's playback state.</p>
<p>By default this property is QMediaPlayer::Stopped</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> QMediaPlayer::State </td><td class="memItemRight bottomAlign"><span class="name"><b>state</b></span>() const</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qmediaplayer.html#stateChanged">stateChanged</a></b></span>(QMediaPlayer::State <i>state</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qmediaplayer.html#mediaStatus-prop">mediaStatus</a>(), <a href="qmediaplayer.html#play">play</a>(), <a href="qmediaplayer.html#pause">pause</a>(), and <a href="qmediaplayer.html#stop">stop</a>().</p>
<!-- @@@state -->
<!-- $$$videoAvailable-prop$$$isVideoAvailable$$$videoAvailableChangedbool -->
<h3 class="fn" id="videoAvailable-prop"><a name="videoAvailable-prop"></a><span class="name">videoAvailable</span> : const <span class="type">bool</span></h3>
<p>This property holds the video availability status for the current media.</p>
<p>If available, the <a href="qvideowidget.html">QVideoWidget</a> class can be used to view the video. As the life time of <a href="qmediaplayer.html">QMediaPlayer</a> can be longer than the playback of one <a href="qmediacontent.html">QMediaContent</a>, this property may change over time, the <a href="qmediaplayer.html#videoAvailableChanged">videoAvailableChanged</a> signal can be used to monitor it's status.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isVideoAvailable</b></span>() const</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qmediaplayer.html#videoAvailableChanged">videoAvailableChanged</a></b></span>(bool <i>videoAvailable</i>)</td></tr>
</table></div>
<p><b>See also </b><a href="qvideowidget.html">QVideoWidget</a> and <a href="qmediacontent.html">QMediaContent</a>.</p>
<!-- @@@videoAvailable -->
<!-- $$$volume-prop$$$volume$$$setVolumeint$$$volumeChangedint -->
<h3 class="fn" id="volume-prop"><a name="volume-prop"></a><span class="name">volume</span> : <span class="type">int</span></h3>
<p>This property holds the current playback volume.</p>
<p>The playback volume is scaled linearly, ranging from <code>0</code> (silence) to <code>100</code> (full volume). Values outside this range will be clamped.</p>
<p>By default the volume is <code>100</code>.</p>
<p>UI volume controls should usually be scaled nonlinearly. For example, using a logarithmic scale will produce linear changes in perceived loudness, which is what a user would normally expect from a volume control. See <a href="qaudio.html#convertVolume">QAudio::convertVolume</a>() for more details.</p>
<p><b>Access functions:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> int </td><td class="memItemRight bottomAlign"><span class="name"><b>volume</b></span>() const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setVolume</b></span>(int <i>volume</i>)</td></tr>
</table></div>
<p><b>Notifier signal:</b></p>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b><a href="qmediaplayer.html#volumeChanged">volumeChanged</a></b></span>(int <i>volume</i>)</td></tr>
</table></div>
<!-- @@@volume -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QMediaPlayer[overload1]$$$QMediaPlayerQObject*QMediaPlayer::Flags -->
<h3 class="fn" id="QMediaPlayer"><a name="QMediaPlayer"></a>QMediaPlayer::<span class="name">QMediaPlayer</span>(<span class="type">QObject</span> *<i>parent</i> = nullptr, <span class="type"><a href="qmediaplayer.html#Flag-enum">QMediaPlayer::Flags</a></span> <i>flags</i> = ...)</h3>
<p>Construct a <a href="qmediaplayer.html">QMediaPlayer</a> instance parented to <i>parent</i> and with <i>flags</i>.</p>
<!-- @@@QMediaPlayer -->
<!-- $$$~QMediaPlayer[overload1]$$$~QMediaPlayer -->
<h3 class="fn" id="dtor.QMediaPlayer"><a name="dtor.QMediaPlayer"></a><code>[virtual] </code>QMediaPlayer::<span class="name">~QMediaPlayer</span>()</h3>
<p>Destroys the player object.</p>
<!-- @@@~QMediaPlayer -->
<!-- $$$audioAvailableChanged -->
<h3 class="fn" id="audioAvailableChanged"><a name="audioAvailableChanged"></a><code>[signal] </code><span class="type">void</span> QMediaPlayer::<span class="name">audioAvailableChanged</span>(<span class="type">bool</span> <i>available</i>)</h3>
<p>Signals the availability of audio content has changed to <i>available</i>.</p>
<p><b>Note:</b> Notifier signal for property <a href="qmediaplayer.html#audioAvailable-prop">audioAvailable</a>. </p><!-- @@@audioAvailableChanged -->
<!-- $$$audioRoleChanged -->
<h3 class="fn" id="audioRoleChanged"><a name="audioRoleChanged"></a><code>[signal] </code><span class="type">void</span> QMediaPlayer::<span class="name">audioRoleChanged</span>(<span class="type"><a href="qaudio.html#Role-enum">QAudio::Role</a></span> <i>role</i>)</h3>
<p>Signals that the audio <i>role</i> of the media player has changed.</p>
<p>This function was introduced in  Qt 5.6.</p>
<p><b>Note:</b> Notifier signal for property <a href="qmediaplayer.html#audioRole-prop">audioRole</a>. </p><!-- @@@audioRoleChanged -->
<!-- $$$availability[overload1]$$$availability -->
<h3 class="fn" id="availability"><a name="availability"></a><code>[override virtual] </code><span class="type"><a href="qmultimedia.html#AvailabilityStatus-enum">QMultimedia::AvailabilityStatus</a></span> QMediaPlayer::<span class="name">availability</span>() const</h3>
<p>Reimplemented from <a href="qmediaobject.html#availability">QMediaObject::availability</a>().</p>
<!-- @@@availability -->
<!-- $$$bufferStatusChanged -->
<h3 class="fn" id="bufferStatusChanged"><a name="bufferStatusChanged"></a><code>[signal] </code><span class="type">void</span> QMediaPlayer::<span class="name">bufferStatusChanged</span>(<span class="type">int</span> <i>percentFilled</i>)</h3>
<p>Signal the amount of the local buffer filled as a percentage by <i>percentFilled</i>.</p>
<p><b>Note:</b> Notifier signal for property <a href="qmediaplayer.html#bufferStatus-prop">bufferStatus</a>. </p><!-- @@@bufferStatusChanged -->
<!-- $$$currentMediaChanged -->
<h3 class="fn" id="currentMediaChanged"><a name="currentMediaChanged"></a><code>[signal] </code><span class="type">void</span> QMediaPlayer::<span class="name">currentMediaChanged</span>(const <span class="type"><a href="qmediacontent.html">QMediaContent</a></span> &amp;<i>media</i>)</h3>
<p>Signals that the current playing content has been changed to <i>media</i>.</p>
<p><b>Note:</b> Notifier signal for property <a href="qmediaplayer.html#currentMedia-prop">currentMedia</a>. </p><p><b>See also </b><a href="qmediaplayer.html#currentMedia-prop">currentMedia</a>() and <a href="qmediaplayer.html#mediaChanged">mediaChanged</a>().</p>
<!-- @@@currentMediaChanged -->
<!-- $$$currentNetworkConfiguration[overload1]$$$currentNetworkConfiguration -->
<h3 class="fn" id="currentNetworkConfiguration"><a name="currentNetworkConfiguration"></a><span class="type">QNetworkConfiguration</span> QMediaPlayer::<span class="name">currentNetworkConfiguration</span>() const</h3>
<p>Returns the current network access point in use. If a default contructed QNetworkConfiguration is returned this feature is not available or that none of the current supplied configurations are in use.</p>
<!-- @@@currentNetworkConfiguration -->
<!-- $$$customAudioRoleChanged -->
<h3 class="fn" id="customAudioRoleChanged"><a name="customAudioRoleChanged"></a><code>[signal] </code><span class="type">void</span> QMediaPlayer::<span class="name">customAudioRoleChanged</span>(const <span class="type">QString</span> &amp;<i>role</i>)</h3>
<p>Signals that the audio <i>role</i> of the media player has changed.</p>
<p>This function was introduced in  Qt 5.11.</p>
<p><b>Note:</b> Notifier signal for property <a href="qmediaplayer.html#customAudioRole-prop">customAudioRole</a>. </p><!-- @@@customAudioRoleChanged -->
<!-- $$$durationChanged -->
<h3 class="fn" id="durationChanged"><a name="durationChanged"></a><code>[signal] </code><span class="type">void</span> QMediaPlayer::<span class="name">durationChanged</span>(<span class="type">qint64</span> <i>duration</i>)</h3>
<p>Signal the duration of the content has changed to <i>duration</i>, expressed in milliseconds.</p>
<p><b>Note:</b> Notifier signal for property <a href="qmediaplayer.html#duration-prop">duration</a>. </p><!-- @@@durationChanged -->
<!-- $$$error[overload1]$$$error -->
<h3 class="fn" id="error"><a name="error"></a><span class="type"><a href="qmediaplayer.html#Error-enum">QMediaPlayer::Error</a></span> QMediaPlayer::<span class="name">error</span>() const</h3>
<p>Returns the current error state.</p>
<!-- @@@error -->
<!-- $$$error$$$errorQMediaPlayer::Error -->
<h3 class="fn" id="error-1"><a name="error-1"></a><code>[signal] </code><span class="type">void</span> QMediaPlayer::<span class="name">error</span>(<span class="type"><a href="qmediaplayer.html#Error-enum">QMediaPlayer::Error</a></span> <i>error</i>)</h3>
<p>Signals that an <i>error</i> condition has occurred.</p>
<p><b>Note:</b> Signal <i>error</i> is overloaded in this class. To connect to this signal by using the function pointer syntax, Qt provides a convenient helper for obtaining the function pointer as shown in this example:<pre class="cpp">

  connect(mediaPlayer<span class="operator">,</span> <span class="type">QOverload</span><span class="operator">&lt;</span><span class="type"><a href="qmediaplayer.html#QMediaPlayer">QMediaPlayer</a></span><span class="operator">::</span>Error<span class="operator">&gt;</span><span class="operator">::</span>of(<span class="operator">&amp;</span><span class="type"><a href="qmediaplayer.html#QMediaPlayer">QMediaPlayer</a></span><span class="operator">::</span>error)<span class="operator">,</span>
      <span class="operator">[</span><span class="operator">=</span><span class="operator">]</span>(<span class="type"><a href="qmediaplayer.html#QMediaPlayer">QMediaPlayer</a></span><span class="operator">::</span>Error error){ <span class="comment">/* ... */</span> });

</pre>
<p><b>See also </b><a href="qmediaplayer.html#error-prop">errorString</a>().</p>
<!-- @@@error -->
<!-- $$$hasSupport[overload1]$$$hasSupportconstQString&constQStringList&QMediaPlayer::Flags -->
<h3 class="fn" id="hasSupport"><a name="hasSupport"></a><code>[static] </code><span class="type"><a href="qmultimedia.html#SupportEstimate-enum">QMultimedia::SupportEstimate</a></span> QMediaPlayer::<span class="name">hasSupport</span>(const <span class="type">QString</span> &amp;<i>mimeType</i>, const <span class="type">QStringList</span> &amp;<i>codecs</i> = QStringList(), <span class="type"><a href="qmediaplayer.html#Flag-enum">QMediaPlayer::Flags</a></span> <i>flags</i> = ...)</h3>
<p>Returns the level of support a media player has for a <i>mimeType</i> and a set of <i>codecs</i>.</p>
<p>The <i>flags</i> argument allows additional requirements such as performance indicators to be specified.</p>
<!-- @@@hasSupport -->
<!-- $$$mediaChanged -->
<h3 class="fn" id="mediaChanged"><a name="mediaChanged"></a><code>[signal] </code><span class="type">void</span> QMediaPlayer::<span class="name">mediaChanged</span>(const <span class="type"><a href="qmediacontent.html">QMediaContent</a></span> &amp;<i>media</i>)</h3>
<p>Signals that the media source has been changed to <i>media</i>.</p>
<p><b>Note:</b> Notifier signal for property <a href="qmediaplayer.html#media-prop">media</a>. </p><p><b>See also </b><a href="qmediaplayer.html#media-prop">media</a>() and <a href="qmediaplayer.html#currentMediaChanged">currentMediaChanged</a>().</p>
<!-- @@@mediaChanged -->
<!-- $$$mediaStatusChanged -->
<h3 class="fn" id="mediaStatusChanged"><a name="mediaStatusChanged"></a><code>[signal] </code><span class="type">void</span> QMediaPlayer::<span class="name">mediaStatusChanged</span>(<span class="type"><a href="qmediaplayer.html#MediaStatus-enum">QMediaPlayer::MediaStatus</a></span> <i>status</i>)</h3>
<p>Signals that the <i>status</i> of the current media has changed.</p>
<p><b>Note:</b> Notifier signal for property <a href="qmediaplayer.html#mediaStatus-prop">mediaStatus</a>. </p><p><b>See also </b><a href="qmediaplayer.html#mediaStatus-prop">mediaStatus</a>().</p>
<!-- @@@mediaStatusChanged -->
<!-- $$$mediaStream[overload1]$$$mediaStream -->
<h3 class="fn" id="mediaStream"><a name="mediaStream"></a>const <span class="type">QIODevice</span> *QMediaPlayer::<span class="name">mediaStream</span>() const</h3>
<p>Returns the stream source of media data.</p>
<p>This is only valid if a stream was passed to <a href="qmediaplayer.html#setMedia">setMedia</a>().</p>
<p><b>See also </b><a href="qmediaplayer.html#setMedia">setMedia</a>().</p>
<!-- @@@mediaStream -->
<!-- $$$mutedChanged -->
<h3 class="fn" id="mutedChanged"><a name="mutedChanged"></a><code>[signal] </code><span class="type">void</span> QMediaPlayer::<span class="name">mutedChanged</span>(<span class="type">bool</span> <i>muted</i>)</h3>
<p>Signal the mute state has changed to <i>muted</i>.</p>
<p><b>Note:</b> Notifier signal for property <a href="qmediaplayer.html#muted-prop">muted</a>. </p><!-- @@@mutedChanged -->
<!-- $$$networkConfigurationChanged[overload1]$$$networkConfigurationChangedconstQNetworkConfiguration& -->
<h3 class="fn" id="networkConfigurationChanged"><a name="networkConfigurationChanged"></a><code>[signal] </code><span class="type">void</span> QMediaPlayer::<span class="name">networkConfigurationChanged</span>(const <span class="type">QNetworkConfiguration</span> &amp;<i>configuration</i>)</h3>
<p>Signal that the active in use network access point has been changed to <i>configuration</i> and all subsequent network access will use this <i>configuration</i>.</p>
<!-- @@@networkConfigurationChanged -->
<!-- $$$pause[overload1]$$$pause -->
<h3 class="fn" id="pause"><a name="pause"></a><code>[slot] </code><span class="type">void</span> QMediaPlayer::<span class="name">pause</span>()</h3>
<p>Pause playing the current source.</p>
<!-- @@@pause -->
<!-- $$$play[overload1]$$$play -->
<h3 class="fn" id="play"><a name="play"></a><code>[slot] </code><span class="type">void</span> QMediaPlayer::<span class="name">play</span>()</h3>
<p>Start or resume playing the current source.</p>
<!-- @@@play -->
<!-- $$$playbackRateChanged -->
<h3 class="fn" id="playbackRateChanged"><a name="playbackRateChanged"></a><code>[signal] </code><span class="type">void</span> QMediaPlayer::<span class="name">playbackRateChanged</span>(<span class="type">qreal</span> <i>rate</i>)</h3>
<p>Signals the <a href="qmediaplayer.html#playbackRate-prop">playbackRate</a> has changed to <i>rate</i>.</p>
<p><b>Note:</b> Notifier signal for property <a href="qmediaplayer.html#playbackRate-prop">playbackRate</a>. </p><!-- @@@playbackRateChanged -->
<!-- $$$positionChanged -->
<h3 class="fn" id="positionChanged"><a name="positionChanged"></a><code>[signal] </code><span class="type">void</span> QMediaPlayer::<span class="name">positionChanged</span>(<span class="type">qint64</span> <i>position</i>)</h3>
<p>Signal the position of the content has changed to <i>position</i>, expressed in milliseconds.</p>
<p><b>Note:</b> Notifier signal for property <a href="qmediaplayer.html#position-prop">position</a>. </p><!-- @@@positionChanged -->
<!-- $$$seekableChanged -->
<h3 class="fn" id="seekableChanged"><a name="seekableChanged"></a><code>[signal] </code><span class="type">void</span> QMediaPlayer::<span class="name">seekableChanged</span>(<span class="type">bool</span> <i>seekable</i>)</h3>
<p>Signals the <i>seekable</i> status of the player object has changed.</p>
<p><b>Note:</b> Notifier signal for property <a href="qmediaplayer.html#seekable-prop">seekable</a>. </p><!-- @@@seekableChanged -->
<!-- $$$setMedia -->
<h3 class="fn" id="setMedia"><a name="setMedia"></a><code>[slot] </code><span class="type">void</span> QMediaPlayer::<span class="name">setMedia</span>(const <span class="type"><a href="qmediacontent.html">QMediaContent</a></span> &amp;<i>media</i>, <span class="type">QIODevice</span> *<i>stream</i> = nullptr)</h3>
<p>Sets the current <i>media</i> source.</p>
<p>If a <i>stream</i> is supplied; media data will be read from it instead of resolving the media source. In this case the media source may still be used to resolve additional information about the media such as mime type. The <i>stream</i> must be open and readable.</p>
<p>Setting the media to a null <a href="qmediacontent.html">QMediaContent</a> will cause the player to discard all information relating to the current media source and to cease all I/O operations related to that media.</p>
<p><b>Note: </b>This function returns immediately after recording the specified source of the media. It does not wait for the media to finish loading and does not check for errors. Listen for the <a href="qmediaplayer.html#mediaStatusChanged">mediaStatusChanged</a>() and <a href="qmediaplayer.html#error">error</a>() signals to be notified when the media is loaded and when an error occurs during loading.</p><p>Since Qt 5.12.2, the url scheme <code>gst-pipeline</code> provides custom pipelines for the GStreamer backend.</p>
<pre class="cpp">

  player <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qmediaplayer.html#QMediaPlayer">QMediaPlayer</a></span>;
  player<span class="operator">-</span><span class="operator">&gt;</span>setMedia(<span class="type">QUrl</span>(<span class="string">&quot;gst-pipeline: videotestsrc ! autovideosink&quot;</span>));
  player<span class="operator">-</span><span class="operator">&gt;</span>play();

</pre>
<p>If the pipeline contains a video sink element named <code>qtvideosink</code>, current <a href="qvideowidget.html">QVideoWidget</a> can be used to render the video.</p>
<p>If the pipeline contains appsrc element, it will be used to push data from <i>stream</i>.</p>
<pre class="cpp">

  <span class="type">QImage</span> img(<span class="string">&quot;images/qt-logo.png&quot;</span>);
  img <span class="operator">=</span> img<span class="operator">.</span>convertToFormat(<span class="type">QImage</span><span class="operator">::</span>Format_ARGB32);
  <span class="type">QByteArray</span> ba(<span class="keyword">reinterpret_cast</span><span class="operator">&lt;</span><span class="keyword">const</span> <span class="type">char</span> <span class="operator">*</span><span class="operator">&gt;</span>(img<span class="operator">.</span>bits())<span class="operator">,</span> img<span class="operator">.</span>sizeInBytes());
  <span class="type">QBuffer</span> buffer(<span class="operator">&amp;</span>ba);
  buffer<span class="operator">.</span>open(<span class="type">QIODevice</span><span class="operator">::</span>ReadOnly);
  player <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qmediaplayer.html#QMediaPlayer">QMediaPlayer</a></span>;
  player<span class="operator">-</span><span class="operator">&gt;</span>setMedia(<span class="type">QUrl</span>(<span class="string">&quot;gst-pipeline: appsrc blocksize=4294967295 ! \
      video/x-raw,format=BGRx,framerate=30/1,width=200,height=147 ! \
      coloreffects preset=heat ! videoconvert ! video/x-raw,format=I420 ! jpegenc ! rtpjpegpay ! \
      udpsink host=127.0.0.1 port=5000&quot;</span>)<span class="operator">,</span> <span class="operator">&amp;</span>buffer);
  player<span class="operator">-</span><span class="operator">&gt;</span>play();

  <span class="type"><a href="qmediaplayer.html#QMediaPlayer">QMediaPlayer</a></span> <span class="operator">*</span>receiver <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qmediaplayer.html#QMediaPlayer">QMediaPlayer</a></span>;
  videoWidget <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qvideowidget.html">QVideoWidget</a></span>;
  receiver<span class="operator">-</span><span class="operator">&gt;</span>setVideoOutput(videoWidget);
  receiver<span class="operator">-</span><span class="operator">&gt;</span>setMedia(<span class="type">QUrl</span>(<span class="string">&quot;gst-pipeline: udpsrc port=5000 ! \
      application/x-rtp,encoding-name=JPEG,payload=26 ! rtpjpegdepay ! jpegdec ! \
      xvimagesink name=qtvideosink&quot;</span>));
  receiver<span class="operator">-</span><span class="operator">&gt;</span>play();
  <span class="comment">// Content will be shown in this widget.</span>
  videoWidget<span class="operator">-</span><span class="operator">&gt;</span>show();

</pre>
<p><b>Note:</b> Setter function for property <a href="qmediaplayer.html#media-prop">media</a>. </p><p><b>See also </b><a href="qmediaplayer.html#media-prop">media</a>().</p>
<!-- @@@setMedia -->
<!-- $$$setNetworkConfigurations[overload1]$$$setNetworkConfigurationsconstQList<QNetworkConfiguration>& -->
<h3 class="fn" id="setNetworkConfigurations"><a name="setNetworkConfigurations"></a><code>[slot] </code><span class="type">void</span> QMediaPlayer::<span class="name">setNetworkConfigurations</span>(const <span class="type">QList</span>&lt;<span class="type">QNetworkConfiguration</span>&gt; &amp;<i>configurations</i>)</h3>
<p>Sets the network access points for remote media playback. <i>configurations</i> contains, in ascending preferential order, a list of configuration that can be used for network access.</p>
<p>This will invalidate the choice of previous configurations.</p>
<!-- @@@setNetworkConfigurations -->
<!-- $$$setVideoOutput[overload1]$$$setVideoOutputQVideoWidget* -->
<h3 class="fn" id="setVideoOutput"><a name="setVideoOutput"></a><span class="type">void</span> QMediaPlayer::<span class="name">setVideoOutput</span>(<span class="type"><a href="qvideowidget.html">QVideoWidget</a></span> *<i>output</i>)</h3>
<p>Attach a <a href="qvideowidget.html">QVideoWidget</a> video <i>output</i> to the media player.</p>
<p>If the media player has already video output attached, it will be replaced with a new one.</p>
<!-- @@@setVideoOutput -->
<!-- $$$setVideoOutput$$$setVideoOutputQGraphicsVideoItem* -->
<h3 class="fn" id="setVideoOutput-1"><a name="setVideoOutput-1"></a><span class="type">void</span> QMediaPlayer::<span class="name">setVideoOutput</span>(<span class="type"><a href="qgraphicsvideoitem.html">QGraphicsVideoItem</a></span> *<i>output</i>)</h3>
<p>Attach a <a href="qgraphicsvideoitem.html">QGraphicsVideoItem</a> video <i>output</i> to the media player.</p>
<p>If the media player has already video output attached, it will be replaced with a new one.</p>
<!-- @@@setVideoOutput -->
<!-- $$$setVideoOutput$$$setVideoOutputQAbstractVideoSurface* -->
<h3 class="fn" id="setVideoOutput-2"><a name="setVideoOutput-2"></a><span class="type">void</span> QMediaPlayer::<span class="name">setVideoOutput</span>(<span class="type"><a href="qabstractvideosurface.html">QAbstractVideoSurface</a></span> *<i>surface</i>)</h3>
<p>Sets a video <i>surface</i> as the video output of a media player.</p>
<p>If a video output has already been set on the media player the new surface will replace it.</p>
<!-- @@@setVideoOutput -->
<!-- $$$stateChanged -->
<h3 class="fn" id="stateChanged"><a name="stateChanged"></a><code>[signal] </code><span class="type">void</span> QMediaPlayer::<span class="name">stateChanged</span>(<span class="type"><a href="qmediaplayer.html#State-enum">QMediaPlayer::State</a></span> <i>state</i>)</h3>
<p>Signal the <i>state</i> of the Player object has changed.</p>
<p><b>Note:</b> Notifier signal for property <a href="qmediaplayer.html#state-prop">state</a>. </p><!-- @@@stateChanged -->
<!-- $$$stop[overload1]$$$stop -->
<h3 class="fn" id="stop"><a name="stop"></a><code>[slot] </code><span class="type">void</span> QMediaPlayer::<span class="name">stop</span>()</h3>
<p>Stop playing, and reset the play position to the beginning.</p>
<!-- @@@stop -->
<!-- $$$supportedAudioRoles[overload1]$$$supportedAudioRoles -->
<h3 class="fn" id="supportedAudioRoles"><a name="supportedAudioRoles"></a><span class="type">QList</span>&lt;<span class="type"><a href="qaudio.html#Role-enum">QAudio::Role</a></span>&gt; QMediaPlayer::<span class="name">supportedAudioRoles</span>() const</h3>
<p>Returns a list of supported audio roles.</p>
<p>If setting the audio role is not supported, an empty list is returned.</p>
<p>This function was introduced in  Qt 5.6.</p>
<p><b>See also </b><a href="qmediaplayer.html#audioRole-prop">audioRole</a>.</p>
<!-- @@@supportedAudioRoles -->
<!-- $$$supportedCustomAudioRoles[overload1]$$$supportedCustomAudioRoles -->
<h3 class="fn" id="supportedCustomAudioRoles"><a name="supportedCustomAudioRoles"></a><span class="type">QStringList</span> QMediaPlayer::<span class="name">supportedCustomAudioRoles</span>() const</h3>
<p>Returns a list of supported custom audio roles. An empty list may indicate that the supported custom audio roles aren't known. The list may not be complete.</p>
<p>This function was introduced in  Qt 5.11.</p>
<p><b>See also </b><a href="qmediaplayer.html#customAudioRole-prop">customAudioRole</a>.</p>
<!-- @@@supportedCustomAudioRoles -->
<!-- $$$videoAvailableChanged -->
<h3 class="fn" id="videoAvailableChanged"><a name="videoAvailableChanged"></a><code>[signal] </code><span class="type">void</span> QMediaPlayer::<span class="name">videoAvailableChanged</span>(<span class="type">bool</span> <i>videoAvailable</i>)</h3>
<p>Signal the availability of visual content has changed to <i>videoAvailable</i>.</p>
<p><b>Note:</b> Notifier signal for property <a href="qmediaplayer.html#videoAvailable-prop">videoAvailable</a>. </p><!-- @@@videoAvailableChanged -->
<!-- $$$volumeChanged -->
<h3 class="fn" id="volumeChanged"><a name="volumeChanged"></a><code>[signal] </code><span class="type">void</span> QMediaPlayer::<span class="name">volumeChanged</span>(<span class="type">int</span> <i>volume</i>)</h3>
<p>Signal the playback volume has changed to <i>volume</i>.</p>
<p><b>Note:</b> Notifier signal for property <a href="qmediaplayer.html#volume-prop">volume</a>. </p><!-- @@@volumeChanged -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>