Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QGraphicsVideoItem problem

QGraphicsVideoItem problem

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 2 Posters 2.2k Views
  • 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
    kkrzewniak
    wrote on last edited by
    #1

    Hi I'm having some truble getting QGraphicsVideoItem to display some video content. The QMediaPlayer states that there were 100+ images provided and 100+ images displayed, but there is no output on the item.

    @#include "SimpleSplash.hpp"
    #include <QTimer>
    #include <QMediaPlayer>
    #include <QUrl>
    #include <QFile>
    #include <QDir>
    #include <QGraphicsScene>
    #include <QGraphicsVideoItem>

    void SimpleSplash::startPlayback()
    {
    #ifdef Q_OS_SYMBIAN
    player->setVideoOutput(videoPlayer);
    if(player->mediaStatus() == QMediaPlayer::LoadedMedia)
    player->play();
    QTimer::singleShot(12000,this,SLOT(movieTimeOut()));
    #else
    emit splashTimeOut();
    QTimer::singleShot(500,this,SLOT(differedClose()));
    #endif
    }

    void SimpleSplash::differedClose()
    {
    player->stop();
    close();
    this->deleteLater();
    }

    void SimpleSplash::movieTimeOut()
    {
    emit splashTimeOut();
    QTimer::singleShot(500,this,SLOT(differedClose()));
    qDebug(player->errorString().toAscii());
    }

    void SimpleSplash::mediaStateChanged()
    {
    qDebug(QString("Media Status %1").arg(player->mediaStatus()).toAscii());
    if(player->mediaStatus() == QMediaPlayer::LoadedMedia)
    {
    startPlayback();
    disconnect(player,SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),this,SLOT(mediaStateChanged()));
    }
    else if(player->mediaStatus() == QMediaPlayer::InvalidMedia)
    {
    disconnect(player,SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),this,SLOT(mediaStateChanged()));
    movieTimeOut();
    }
    }

    SimpleSplash::SimpleSplash(QWidget *parent) :
    QGraphicsView(parent)
    {
    videoPlayer = new QGraphicsVideoItem;
    player = new QMediaPlayer(this);
    QDir dir;
    player->setMedia(QUrl::fromLocalFile(dir.absoluteFilePath("symbian_intro_anim_360x640_intro.mp4")));
    connect(player,SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),this,SLOT(mediaStateChanged()));
    qDebug(player->errorString().toAscii());

    QGraphicsScene *scene = new QGraphicsScene(0,0,360,640);
    setScene(scene);
    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    scene->addItem(videoPlayer);
    scene->setBackgroundBrush(QBrush(QPixmap(":/eyecandy/spalsh/landing_screen.jpg")));
    setFrameStyle(QFrame::NoFrame);
    

    }

    SimpleSplash::~SimpleSplash()
    {
    delete videoPlayer;
    }
    @

    I'm using Qt 4.6.3 and Mobility 1.0.2

    Me, Grimlock, not "nice dino". ME BASH BRAINS!

    1 Reply Last reply
    0
    • J Offline
      J Offline
      justin.mcpherson
      wrote on last edited by
      #2

      There is no support for QGraphicsVideoItem on Symbian in 1.0. You should try 1.1+.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kkrzewniak
        wrote on last edited by
        #3

        Thanks. I was also trying to run QVideoWidget witch ran fine on S^3 but panicked on S60 on this line.
        @player->setVideoOutput(videoPlayer);@

        It throws 6

        Invalid window handle.

        A handle which should have referred to a window of a particular type referred to a window of another type, or the object index didn’t recognise the handle.

        On the server side, this panic is ultimately raised by CWsClient::HandleToWindow() and CWsClient::HandleToClientWindow() during handle conversions.

        Me, Grimlock, not "nice dino". ME BASH BRAINS!

        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