流光.py
import vlc # libVLC
import time
class Streamer():
def __init__(self):
self.Instance = vlc.Instance()
sout = "#transcode{acodec=mp3,ab=128,channels=2,samplerate=44100}:http{dst=:8090/streamer.mp3}"
self.media_files = ["file.mp3", "file2.mp3"]
self.Instance.vlm_add_broadcast("0", self.media_files[0], sout, 0, None, True, False)
self.Instance.vlm_add_broadcast("1", self.media_files[1], sout, 0, None, True, False)
self.Instance.vlm_play_media("0")
time.sleep(10)
self.Instance.vlm_stop_media("0")
self.Instance.vlm_play_media("1")
time.sleep(10)
rs = RasStreamer()
玩家:
我在客户端使用 Jplayer ( demo-8 )。
问题:
一旦我停止媒体“0”并播放媒体“1”,它就会停止我的播放器,我必须再次按下播放按钮。有没有办法在不停止播放器的情况下切换媒体?