Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QML Video Element Reference

The Video element allows you to add videos to a scene. More...

Properties

Signals

Methods

Detailed Description

This element is part of the Qt.multimedia 1.0 module.

    import Qt 4.7
    import Qt.multimedia 1.0

    Video {
        id: video
        width : 800
        height : 600
        source: "video.avi"

        MouseArea {
            anchors.fill: parent
            onClicked: {
                video.play()
            }
        }

        focus: true
        Keys.onSpacePressed: video.paused = !video.paused
        Keys.onLeftPressed: video.position -= 5000
        Keys.onRightPressed: video.position += 5000
    }

The Video item supports untransformed, stretched, and uniformly scaled video presentation. For a description of stretched uniformly scaled presentation, see the fillMode property description.

The Video item is only visible when the hasVideo property is true and the video is playing.

See also Audio.


Property Documentation

albumArtist : variant

This property holds the name of the principal artist of the album the media belongs to.

See also QtMultimediaKit::AlbumArtist.


albumTitle : variant

This property holds the title of the album the media belongs to.

See also QtMultimediaKit::AlbumTitle.


audioBitRate : variant

This property holds the bit rate of the media's audio stream ni bits per second.

See also QtMultimediaKit::AudioBitRate.


audioCodec : variant

This property holds the encoding of the media audio stream.

See also QtMultimediaKit::AudioCodec.


author : variant

This property holds the author of the media.

See also QtMultimediaKit::Author.


autoLoad : url

This property indicates if loading of media should begin immediately.

Defaults to true, if false media will not be loaded until playback is started.


averageLevel : variant

This property holds the average volume level of the media.

See also QtMultimediaKit::AverageLevel.


bufferProgress : real

This property holds how much of the data buffer is currently filled, from 0.0 (empty) to 1.0 (full).


category : variant

This property holds the category of the media

See also QtMultimediaKit::Category.


channelCount : variant

This property holds the number of channels in the media's audio stream.

See also QtMultimediaKit::ChannelCount.


chapterNumber : variant

This property holds the chapter number of the media.

See also QtMultimediaKit::ChapterNumber.


comment : variant

This property holds a user comment about the media.

See also QtMultimediaKit::Comment.


composer : variant

This property holds the composer of the media.

See also QtMultimediaKit::Composer.


conductor : variant

This property holds the conductor of the media.

See also QtMultimediaKit::Conductor.


contributingArtist : variant

This property holds the names of artists contributing to the media.

See also QtMultimediaKit::ContributingArtist.


copyright : variant

This property holds the media's copyright notice.

See also QtMultimediaKit::Copyright.


coverArtUrlLarge : variant

This property holds the URL of a large cover art image.

See also QtMultimediaKit::CoverArtUrlLarge.


coverArtUrlSmall : variant

This property holds the URL of a small cover art image.

See also QtMultimediaKit::CoverArtUrlSmall.


date : variant

This property holds the date of the media.

See also QtMultimediaKit::Date.


description : variant

This property holds a description of the media.

See also QtMultimediaKit::Description.


director : variant

This property holds the director of the media.

See also QtMultimediaKit::Director.


read-onlyduration : int

This property holds the duration of the media in milliseconds.

If the media doesn't have a fixed duration (a live stream for example) this will be 0.


error : enumeration

This property holds the error state of the video. It can be one of:

  • NoError - there is no current error.
  • ResourceError - the video cannot be played due to a problem allocating resources.
  • FormatError - the video format is not supported.
  • NetworkError - the video cannot be played due to network issues.
  • AccessDenied - the video cannot be played due to insufficient permissions.
  • ServiceMissing - the video cannot be played because the media service could not be instantiated.

read-onlyerrorString : string

This property holds a string describing the current error condition in more detail.


fillMode : enumeration

Set this property to define how the video is scaled to fit the target area.

  • Stretch - the video is scaled to fit.
  • PreserveAspectFit - the video is scaled uniformly to fit without cropping
  • PreserveAspectCrop - the video is scaled uniformly to fill, cropping if necessary

The default fill mode is PreserveAspectFit.


genre : variant

This property holds the genre of the media.

See also QtMultimediaKit::Genre.


hasAudio : bool

This property holds whether the media contains audio.


hasVideo : bool

This property holds whether the media contains video.


keywords : variant

This property holds a list of keywords describing the media.

See also QtMultimediaKit::Keywords.


language : variant

This property holds the language of the media, as an ISO 639-2 code.

See also QtMultimediaKit::Language.


leadPerformer : variant

This property holds the lead performer in the media.

See also QtMultimediaKit::LeadPerformer.


lyrics : variant

This property holds the lyrics to the media.

See also QtMultimediaKit::Lyrics.


mediaType : variant

This property holds the type of the media.

See also QtMultimediaKit::MediaType.


mood : variant

This property holds the mood of the media.

See also QtMultimediaKit::Mood.


muted : bool

This property holds whether the audio output is muted.


parentalRating : variant

This property holds the parental rating of the media.

See also QtMultimediaKit::ParentalRating.


paused : bool

This property holds whether the media is paused.

Defaults to false, and can be set to true to pause playback.


peakValue : variant

This property holds the peak volume of media's audio stream.

See also QtMultimediaKit::PeakValue.


pixelAspectRatio : variant

This property holds the pixel aspect ratio of an image or video.

See also QtMultimediaKit::PixelAspectRatio.


playbackRate : real

This property holds the rate at which video is played at as a multiple of the normal rate.


playing : bool

This property holds whether the media is playing.

Defaults to false, and can be set to true to start playback.


position : int

This property holds the current playback position in milliseconds.


posterUrl : variant

This property holds the URL of a poster image.

See also QtMultimediaKit::PosterUrl.


publisher : variant

This property holds the publisher of the media.

See also QtMultimediaKit::Publisher.


ratingOrganisation : variant

This property holds the name of the rating organisation responsible for the parental rating of the media.

See also QtMultimediaKit::RatingOrganisation.


resolution : variant

This property holds the dimension of an image or video.

See also QtMultimediaKit::Resolution.


sampleRate : variant

This property holds the sample rate of the media's audio stream in hertz.

See also QtMultimediaKit::SampleRate.


seekable : bool

This property holds whether position of the video can be changed.


size : variant

This property property holds the size of the media in bytes.

See also QtMultimediaKit::Size.


source : url

This property holds the source URL of the media.


read-onlystatus : enumeration

This property holds the status of media loading. It can be one of:

  • NoMedia - no media has been set.
  • Loading - the media is currently being loaded.
  • Loaded - the media has been loaded.
  • Buffering - the media is buffering data.
  • Stalled - playback has been interrupted while the media is buffering data.
  • Buffered - the media has buffered data.
  • EndOfMedia - the media has played to the end.
  • InvalidMedia - the media cannot be played.
  • UnknownStatus - the status of the media is cannot be determined.

subTitle : variant

This property holds the sub-title of the media.

See also QtMultimediaKit::SubTitle.


title : variant

This property holds the tile of the media.

See also QtMultimediaKit::Title.


trackCount : variant

This property holds the number of track on the album containing the media.

See also QtMultimediaKit::TrackNumber.


trackNumber : variant

This property holds the track number of the media.

See also QtMultimediaKit::TrackNumber.


userRating : variant

This property holds a user rating of the media in the range of 0 to 100.

See also QtMultimediaKit::UserRating.


videoBitRate : variant

This property holds the bit rate of the media's video stream in bits per second.

See also QtMultimediaKit::VideoBitRate.


videoCodec : variant

This property holds the encoding of the media's video stream.

See also QtMultimediaKit::VideoCodec.


videoFrameRate : variant

This property holds the frame rate of the media's video stream.

See also QtMultimediaKit::VideoFrameRate.


volume : real

This property holds the volume of the audio output, from 0.0 (silent) to 1.0 (maximum volume).


writer : variant

This property holds the writer of the media.

See also QtMultimediaKit::Writer.


year : variant

This property holds the year of release of the media.

See also QtMultimediaKit::Year.


Signal Documentation

Video::onBuffered ()

This handler is called when the media has finished buffering.


Video::onBuffering ()

This handler is called when the media starts buffering.


Video::onEndOfMedia ()

This handler is called when playback stops because end of the media has been reached.


Video::onError ( error, errorString )

This handler is called when an error has occurred. The errorString parameter may contain more detailed information about the error.


Video::onLoaded ()

This handler is called when the media source has been loaded.


Video::onPaused ()

This handler is called when playback is paused.


Video::onResumed ()

This handler is called when playback is resumed from the paused state.


Video::onStalled ()

This handler is called when playback has stalled while the media buffers.


Video::onStarted ()

This handler is called when playback is started.


Video::onStopped ()

This handler is called when playback is stopped.


Method Documentation

Video::pause ()

Pauses playback of the media.

Sets the playing and paused properties to true.


Video::play ()

Starts playback of the media.

Sets the playing property to true, and the paused property to false.


Video::stop ()

Stops playback of the media.

Sets the playing and paused properties to false.


Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 94
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 42
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 9
  7. Qt Commercial : Digia organise un webinar gratuit le 27 mars sur la conception d'interfaces utilisateur et d'applications avec le framework 0
Page suivante

Le blog Digia au hasard

Logo

Déploiement d'applications Qt Commercial sur les tablettes Windows 8

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtmobility-1.0
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web