from PyQt5.QtCore import QUrl from PyQt5.QtMultimedia import QMediaContent url = QUrl.fromLocalFile("/path/to/local/file.mp3") content = QMediaContent(url)
from PyQt5.QtCore import QUrl from PyQt5.QtMultimedia import QMediaContent url = QUrl("http://example.com/stream.mp4") content = QMediaContent(url)Package library: PyQt5.