PDA

View Full Version : Phonon Videoplayer Stucks When Navigated and returned



vishnu717
14th June 2011, 05:56
This is the code used to create Video player in the Constructor of the video class



videoplayer=new Phonon::VideoPlayer(Phonon::VideoCategory,this);
videoplayer->setGeometry(QRect(190, 85, 549, 366));
volumeSlider = new Phonon::VolumeSlider(this);
volumeSlider->setObjectName(QString::fromUtf8("volumeSlider"));
volumeSlider->setGeometry(QRect(614, 465, 100, 22));
volumeSlider->setAudioOutput(videoplayer->audioOutput());
volumeSlider->setMuteVisible(true);
volumeSlider->setStyleSheet(" background:none; border:none;");
volumeSlider->setCursor(Qt::PointingHandCursor);

seeksilder = new Phonon::SeekSlider(this);
seeksilder->setGeometry(QRect(390, 465, 210, 22));
seeksilder->setMediaObject(videoplayer->mediaObject());
seeksilder->setStyleSheet(" background:none; border:none;");
seeksilder->setCursor(Qt::PointingHandCursor);
videoplayer->load(Phonon::MediaSource ("video.wmv"));
videoplayer->play(Phonon::MediaSource("video.wmv"));







When navigated to other window this code is used in button click


videoplayer->stop();
startWindow *start=new startWindow;
start->show();
this->close();






When returned to the video class , this code is used



videoclass *m=new videoclass;
m->show();
this->hide();










The Problem is that when navigated four or five times, there is no problem for the videoplayer in the video class . But after 6 times, videoplayer gets stuck and no video is displayed but we can hear the audio , and the control the seek slider and volume slider is gone .

Since I am Beginner in qt , I need the help and advise of experienced qt programmers , please help me