本文整理汇总了Python中PyQt5.QtMultimedia.QMediaPlaylist方法的典型用法代码示例。如果您正苦于以下问题:Python QtMultimedia.QMediaPlaylist方法的具体用法?Python QtMultimedia.QMediaPlaylist怎么用?Python QtMultimedia.QMediaPlaylist使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtMultimedia
的用法示例。
在下文中一共展示了QtMultimedia.QMediaPlaylist方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_file
# 需要导入模块: from PyQt5 import QtMultimedia [as 别名]
# 或者: from PyQt5.QtMultimedia import QMediaPlaylist [as 别名]
def set_file(self, url):
self.label.setText(url.fileName())
if url.scheme() == '':
url.setScheme('file')
content = qtmm.QMediaContent(url)
#self.player.setMedia(content)
# Looping
# must retain a reference to the playlist
# hence self.playlist
self.playlist = qtmm.QMediaPlaylist()
self.playlist.addMedia(content)
self.playlist.setCurrentIndex(1)
self.player.setPlaylist(self.playlist)
self.loop_cb.setChecked(False)
示例2: load_soundtrack_playlist
# 需要导入模块: from PyQt5 import QtMultimedia [as 别名]
# 或者: from PyQt5.QtMultimedia import QMediaPlaylist [as 别名]
def load_soundtrack_playlist():
"""
Loads the play list of the soundtracks and replaces the file name with the full path.
A playlist is a list where each entry is a list of two strings: file path, title
"""
global soundtrack_playlist
# create playlist
soundtrack_playlist = QtMultimedia.QMediaPlaylist()
soundtrack_playlist.setPlaybackMode(QtMultimedia.QMediaPlaylist.Loop)
# read information file
data = utils.read_as_yaml(constants.SOUNDTRACK_INFO_FILE)
# add the soundtrack folder to each file name
for entry in data:
file = constants.extend(constants.SOUNDTRACK_FOLDER, entry[0])
url = qt.local_url(file)
media = QtMultimedia.QMediaContent(url)
soundtrack_playlist.addMedia(media)
示例3: __init__
# 需要导入模块: from PyQt5 import QtMultimedia [as 别名]
# 或者: from PyQt5.QtMultimedia import QMediaPlaylist [as 别名]
def __init__(self):
super(VideoPlayer, self).__init__()
self._player = QMediaPlayer()
self._playlist = QMediaPlaylist()
self._stopped = True
# プレイリストに動画を追加
示例4: on_loop_cb
# 需要导入模块: from PyQt5 import QtMultimedia [as 别名]
# 或者: from PyQt5.QtMultimedia import QMediaPlaylist [as 别名]
def on_loop_cb(self, state):
if state == qtc.Qt.Checked:
self.playlist.setPlaybackMode(
qtmm.QMediaPlaylist.CurrentItemInLoop)
else:
self.playlist.setPlaybackMode(
qtmm.QMediaPlaylist.CurrentItemOnce)
示例5: __init__
# 需要导入模块: from PyQt5 import QtMultimedia [as 别名]
# 或者: from PyQt5.QtMultimedia import QMediaPlaylist [as 别名]
def __init__(self):
super().__init__()
self.player = QtMultimedia.QMediaPlayer()
self.playlist = QtMultimedia.QMediaPlaylist()
self.player.setPlaylist(self.playlist)
self.player.playlist().currentMediaChanged.connect(self.disable_advert_controls)
self.advert_in_progress = False
self.advert_counter = self.total_songs_between_adverts - 1
self.init_ui()