感谢 Qt 5.5 QMediaPlayer,我正在尝试使用 UNC 路径从网络加载视频。代码片段如下:
projectDirectory = QFileDialog::getExistingDirectory (this,
tr ("Choose project folder (sensor + video data"),
QDir::homePath(), QFileDialog::ShowDirsOnly);
QDir dir(projectDirectory);
QStringList test = dir.entryList();
qDebug () << projectDirectory << "contains:" << endl << test;
mediaPlayer.setMedia(QUrl::fromLocalFile(projectDirectory+"/video.mov"));
该代码片段适用于本地文件,但在路径以//
.
示例输出:
"//m4800/Partage/111" contains:
(".", "..", "HandBrake.txt", "sensors.csv", "video.mov")
DirectShowPlayerService::doSetUrlSource: Unresolved error code 80004005
请注意,我能够读取sensors.csv
文本文件并且video.mov
具有相同的权限。