Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QMediaPlayer on Ubuntu 12.04

QMediaPlayer on Ubuntu 12.04

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 7.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • mgilormaM Offline
    mgilormaM Offline
    mgilorma
    wrote on last edited by
    #1

    I am working on an application that needs to play various sounds for user interaction and am having trouble getting them to work on Ubuntu. I upgraded to QT5 so I could use QMediaPlayer and it works fine on Windows. However when I try to run it on my ubuntu system I get the following error when I try to load the file for playing:

    GStreamer; Unable to pause "file: beep.mp3"
    Error: "could not open resource for reading"

    and I get the following error when I try to play it:

    Gstreamer; Unable to play "file: beep.mp3"
    Error: "No URI set"

    I know the file beep.mp3 is in the correct directory because I check for it using QFile::exists. It seems like it is a GStreamer/Qt interaction problem.

    Thanks in advance!

    1 Reply Last reply
    0
    • mgilormaM Offline
      mgilormaM Offline
      mgilorma
      wrote on last edited by
      #2

      Turns out that I just needed to use the absolute path.

      old code:
      player->setMedia(QUrl::fromLocalFile("beep.mp3"));

      new code
      player->setMedia(QUrl::fromLocalFile("/home/test/beep.mp3"));

      Easy fix.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved