• PySide 模块
  • PySide.phonon
  • 内容表

    上一话题

    Phonon.VideoWidget

    下一话题

    Phonon.SeekSlider

    Phonon.VideoPlayer

    概要

    信号

    详细描述

    VideoPlayer widget is used to perform playback of video.

    With VideoPlayer you can get results quickly and easily. You can do the standard playback tasks like PySide.phonon.Phonon::VideoPlayer.play() , PySide.phonon.Phonon::VideoPlayer.pause() ,和 PySide.phonon.Phonon::VideoPlayer.stop() , but also set a playback volume and seek - if the media and backend supports seeking.

    VideoPlayer is provided for convenience and removes the need to create a media graph with a Phonon.MediaObject , Phonon.AudioOutput ,和 Phonon.VideoWidget . If you need functionality not supported by the player, you can build this graph yourself.

    Keep in mind that when the VideoPlayer instance is deleted the playback will stop.

    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 PySide.phonon.Phonon::VideoPlayer.play() 函数。

    A play and forget code example:

    <Code snippet "doc/src/snippets/code/doc_src_phonon-api.cpp:4" not found>
    									

    另请参阅

    Phonon Module MediaObject

    class PySide.phonon.Phonon. VideoPlayer ( category [ , parent=None ] )
    class PySide.phonon.Phonon. VideoPlayer ( [ parent=None ] )
    参数:

    Constructs a new video widget with a parent 使用 Phonon.VideoCategory as its category.

    parent PySide.QtCore.QObject parent.

    PySide.phonon.Phonon.VideoPlayer. audioOutput ( )
    返回类型: PySide.phonon.Phonon::AudioOutput

    Returns the audio output object being used by the player.

    PySide.phonon.Phonon.VideoPlayer. currentTime ( )
    返回类型: PySide.QtCore.qint64

    Get the current time (in milliseconds) of the file currently being played.

    PySide.phonon.Phonon.VideoPlayer. finished ( )
    PySide.phonon.Phonon.VideoPlayer. isPaused ( )
    返回类型: PySide.QtCore.bool

    Returns true if it is currently paused; otherwise returns false if it is currently playing or stopped.

    PySide.phonon.Phonon.VideoPlayer. isPlaying ( )
    返回类型: PySide.QtCore.bool

    Returns true if it is currently playing; otherwise returns false if it is currently stopped or paused

    PySide.phonon.Phonon.VideoPlayer. load ( source )
    参数: source PySide.phonon.Phonon::MediaSource
    PySide.phonon.Phonon.VideoPlayer. mediaObject ( )
    返回类型: PySide.phonon.Phonon::MediaObject

    Returns the media object being used by the player.

    The media object can be accessed directly instead of using the VideoPlayer s convenience functions, e.g., PySide.phonon.Phonon::VideoPlayer.play() and PySide.phonon.Phonon::VideoPlayer.stop() . It is also possible to give the object to other Phonon widgets, e.g., a Phonon.SeekSlider Phonon.VolumeSlider .

    另请参阅

    Phonon.SeekSlider Phonon.MediaObject

    PySide.phonon.Phonon.VideoPlayer. pause ( )

    Pauses the playback.

    另请参阅

    MediaObject.pause()

    PySide.phonon.Phonon.VideoPlayer. play ( source )
    参数: source PySide.phonon.Phonon::MediaSource
    PySide.phonon.Phonon.VideoPlayer. play ( )

    Continues playback of paused media. Restarts playback of a stopped (or newly loaded) media.

    另请参阅

    MediaObject.play() PySide.phonon.Phonon::VideoPlayer.play()

    PySide.phonon.Phonon.VideoPlayer. seek ( ms )
    参数: ms PySide.QtCore.qint64

    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 VideoPlayer .

    player->mediaObject()->isSeekable();
    										

    ms parameter is the time in milliseconds from the start of the media.

    The call is asynchronous, so PySide.phonon.Phonon::VideoPlayer.currentTime() 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 SeekSlider .

    另请参阅

    MediaObject.seek() MediaObject.isSeekable() PySide.phonon.Phonon::VideoPlayer.mediaObject()

    PySide.phonon.Phonon.VideoPlayer. setVolume ( volume )
    参数: volume PySide.QtCore.float

    设置 volume of the output as voltage factor.

    1.0 means 100%, 0.5 means 50% voltage/25% power, 0.0 means 0%

    另请参阅

    PySide.phonon.Phonon::VideoPlayer.volume()

    PySide.phonon.Phonon.VideoPlayer. stop ( )

    Stops the playback.

    另请参阅

    MediaObject.stop()

    PySide.phonon.Phonon.VideoPlayer. totalTime ( )
    返回类型: PySide.QtCore.qint64

    Get the total time (in milliseconds) of the file currently being played.

    PySide.phonon.Phonon.VideoPlayer. videoWidget ( )
    返回类型: PySide.phonon.Phonon::VideoWidget

    Returns the video widget being used by the player.

    PySide.phonon.Phonon.VideoPlayer. volume ( )
    返回类型: PySide.QtCore.float

    This is the current volume of the output as voltage factor.

    1.0 means 100%, 0.5 means 50% voltage/25% power, 0.0 means 0%

    另请参阅

    PySide.phonon.Phonon::VideoPlayer.setVolume()