Video Play



  • hi,

     i am using following code for playing video.
    

    @
    /******************************************************************/
    playlist = new QMediaPlaylist;
    playlist->addMedia(QUrl("http://abc/video/video1.3gp"));
    playlist->addMedia(QUrl("http://abc/video/video2.3gp"));
    playlist->addMedia(QUrl("http://abc/video/video3.3gp"));
    playlist->setCurrentIndex(1);

             player = new QMediaPlayer;
             connect(player, SIGNAL(positionChanged(qint64)), this, SLOT(positionChanged(qint64)));
             connect(player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), this, SLOT(mediaStatusChanged(QMediaPlayer::MediaStatus)));
             connect(player, SIGNAL(error(QMediaPlayer::Error)), this, SLOT(error(QMediaPlayer::Error)));
             player->setPlaylist(playlist);
    
             Qm_pQVideoWidget = new QVideoWidget(this);
             player->setVideoOutput(Qm_pQVideoWidget);
             Qm_pQVideoWidget->show();
             player->play(); 
    

    /******************************************************************/
    @
    then it gives error msg

    "DirectShowPlayerService::doRender: Unresolved error code 8007000d"
    and
    "QMediaPlayer::ResourceError (1)"

    how to solve it.

    [[mark up code, Tobias]]


  • Moderators

    Which platform are you trying to run this on?



  • i am creating a Mobile and embedded project.
    for Symbian device on Qt creator.
    in windows.
    and test it on Qt simulator.



  • Videos doesnt work on simulator, to test videos use a mobile to deploy and test :)



  • thanks for reply

    now i have try following code
    @
    /********************************************/
    playlist = new QMediaPlaylist;
    QString filepath;
    filepath.clear();
    filepath.append("E:\data/abc.3gp");
    QMediaResource resource(QUrl::fromLocalFile(filepath));
    QMediaContent content(resource);
    playlist->addMedia(content);
    playlist->setCurrentIndex(1);

    player = new QMediaPlayer;
    connect(player, SIGNAL(positionChanged(qint64)), this, SLOT(positionChanged(qint64)));
    connect(player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), this, SLOT(mediaStatusChanged(QMediaPlayer::MediaStatus)));
    connect(player, SIGNAL(error(QMediaPlayer::Error)), this, SLOT(error(QMediaPlayer::Error)));
    connect(player, SIGNAL(stateChanged(QMediaPlayer::State)), this, SLOT(stateChanged(QMediaPlayer::State)));
    player->setPlaylist(playlist);
    Qm_pQVideoWidget = new QVideoWidget(this);
    player->setVideoOutput(Qm_pQVideoWidget);
    Qm_pQVideoWidget->show();
    Qm_pQVideoWidget->activateWindow();
    Qm_pQVideoWidget->showFullScreen();
    /********************************************/
    @
    when i run this code on simulator only i can listen video,i can't see video

    and when i run on device it crash.....

    [Edit: Please wrap code in @ tags; mlong]



  • plz reply..............


  • Moderators

    [quote author="GentooXativa" date="1328171777"]Videos doesnt work on simulator, to test videos use a mobile to deploy and test :)[/quote]

    Where is it crashing? Have you run it under the debugger?



  • no i am not using debugger.
    it was crashing on Device.

    i create a new Form & past this code on new form.
    now it is not crashing , but video is not playing......
    i can see only blank form.....
    i want to play video......



  • plz reply....


  • Moderators

    Please do not demand that people reply.

    We are all volunteers here. If anyone has information that can help you, they will try to do so.

    Be patient.



  • thanks "mlong"
    i am waiting for reply......



  • plz reply.....



  • [quote author="hitesh" date="1328591743"]thanks "mlong"
    i am waiting for reply......
    [/quote]

    [quote author="hitesh" date="1329110767"]plz reply.....[/quote]

    I see some discrepancy here.



  • Sorry i only worked with video using the QML Video Element


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.