GStreamer;无法暂停 - "";错误:“未设置 URI” - MediaPlayer QML 类型

Posted

技术标签:

【中文标题】GStreamer;无法暂停 - "";错误:“未设置 URI” - MediaPlayer QML 类型【英文标题】:GStreamer; Unable to pause - ""; Error: "No URI set" - MediaPlayer QML Type 【发布时间】:2015-09-30 09:43:45 【问题描述】:

从http://doc.qt.io/qt-5/qml-qtmultimedia-mediaplayer.html#details 尝试以下操作

import QtQuick 2.4
import QtQuick.Window 2.2
import QtMultimedia 5.0

Window

    visible: true
    height: 1000
    width: 1000


    MediaPlayer 
        id: mediaplayer
        source: "/home/****/template/v1.avi"
    

    VideoOutput 
        anchors.fill: parent
        source: mediaplayer
    

    MouseArea 
        id: playArea
        anchors.fill: parent
        onPressed: mediaplayer.play();
    

Ubuntu 14.04.2 LTS \n \l

GStreamer Core Library version 0.10.36

这会在点击时给出标题中显示的错误。 我已确认该文件存在。

现在还能做什么?

【问题讨论】:

【参考方案1】:

在Linux中设置url的方法是:

file:///home/***/template/v1.avi

所以,source: "/home/****/template/v1.avi" 应该替换为:

source: "file:///home/***/template/v1.avi"

【讨论】:

以上是关于GStreamer;无法暂停 - "";错误:“未设置 URI” - MediaPlayer QML 类型的主要内容,如果未能解决你的问题,请参考以下文章