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. Phonon::VideoPlayer

Phonon::VideoPlayer

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 3.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.
  • K Offline
    K Offline
    krisztiantobias
    wrote on last edited by
    #1

    How can I create a realy simple video player with Phonon? (which can play the avi files)
    I search one tutorial/example/program many hours ago, but I did not find, which it worked.
    Thanks!

    1 Reply Last reply
    0
    • B Offline
      B Offline
      broadpeak
      wrote on last edited by
      #2

      For starting (from this book: "Advanced Qt Programming"):
      @
      MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
      {
      playIcon = QIcon(":/play.png");
      pauseIcon = QIcon(":/pause.png");
      mediaObject = new Phonon::MediaObject(this);
      mediaObject->setTickInterval(OneSecond);
      videoWidget = new Phonon::VideoWidget(this);
      Phonon::createPath(mediaObject, videoWidget);
      audioOutput = new Phonon::AudioOutput(Phonon::VideoCategory, this);
      Phonon::createPath(mediaObject, audioOutput);
      createActions();
      createToolBar();
      createWidgets();
      createLayout();
      createConnections();
      setWindowTitle(QApplication::applicationName());
      }

      ...
      // i.e: one method of the others:
      void MainWindow::playOrPause()
      {
      switch (mediaObject->state()) {
      case Phonon::PlayingState:
      mediaObject->pause();
      playOrPauseAction->setIcon(playIcon);
      break;
      case Phonon::PausedState: // Fallthrough
      case Phonon::StoppedState:
      mediaObject->play();
      playOrPauseAction->setIcon(pauseIcon);
      break;
      default:
      break;
      }
      }
      @

      Edit: please use @ tags around code sections; Andre

      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