qtmobility/tests/playerex_s60/player.cpp
changeset 4 90517678cc4f
parent 1 2b40d63a9c3d
child 5 453da2cfceef
equal deleted inserted replaced
1:2b40d63a9c3d 4:90517678cc4f
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the Qt Mobility Components.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 #include "player.h"
       
    43 
       
    44 #include "playercontrols.h"
       
    45 #include "videowidget.h"
       
    46 
       
    47 #include <qmediaservice.h>
       
    48 #include <qmediaplaylist.h>
       
    49 
       
    50 #include <QtGui>
       
    51 #include <QDomDocument>
       
    52 
       
    53 S60Player::S60Player(QMainWindow *parent)
       
    54     : QMainWindow(parent)
       
    55     , videoWidget(0)
       
    56     , coverLabel(0)
       
    57     , slider(0)
       
    58     , colorDialog(0)
       
    59 {
       
    60     player = new QMediaPlayer(this);
       
    61     player->setVolume(50);
       
    62     playlist = new QMediaPlaylist(this);
       
    63     playlist->setMediaObject(player);
       
    64 
       
    65     connect(player, SIGNAL(durationChanged(qint64)), SLOT(durationChanged(qint64)));
       
    66     connect(player, SIGNAL(positionChanged(qint64)), SLOT(positionChanged(qint64)));
       
    67     connect(player, SIGNAL(metaDataChanged()), SLOT(metaDataChanged()));
       
    68     connect(player, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),
       
    69             this, SLOT(statusChanged(QMediaPlayer::MediaStatus)));
       
    70     connect(player, SIGNAL(bufferStatusChanged(int)), this, SLOT(bufferingProgress(int)));
       
    71 
       
    72     videoWidget = new VideoWidget;
       
    73     videoWidget->setMediaObject(player);
       
    74 
       
    75     slider = new QSlider(Qt::Horizontal);
       
    76     slider->setRange(0, player->duration() / 1000);
       
    77 
       
    78     connect(slider, SIGNAL(sliderMoved(int)), this, SLOT(seek(int)));
       
    79     QPushButton *openButton = new QPushButton(tr("Open"));
       
    80     openButton->setIcon(style()->standardIcon(QStyle::SP_DialogOpenButton));
       
    81 
       
    82     connect(openButton, SIGNAL(clicked()), this, SLOT(open()));
       
    83 
       
    84     PlayerControls *controls = new PlayerControls;
       
    85     controls->setState(player->state());
       
    86     controls->setMuted(controls->isMuted());
       
    87 
       
    88     connect(controls, SIGNAL(play()), player, SLOT(play()));
       
    89     connect(controls, SIGNAL(pause()), player, SLOT(pause()));
       
    90     connect(controls, SIGNAL(next()), playlist, SLOT(next()));
       
    91     connect(controls, SIGNAL(previous()), playlist, SLOT(previous()));
       
    92     connect(controls, SIGNAL(changeMuting(bool)), player, SLOT(setMuted(bool)));
       
    93 
       
    94     connect(player, SIGNAL(stateChanged(QMediaPlayer::State)),
       
    95             controls, SLOT(setState(QMediaPlayer::State)));
       
    96     connect(player, SIGNAL(mutedChanged(bool)), controls, SLOT(setMuted(bool)));    
       
    97 
       
    98     QHBoxLayout *displayLayout = new QHBoxLayout;
       
    99     coverLabel = new QLabel(this);        
       
   100     if (videoWidget)
       
   101         displayLayout->addWidget(videoWidget, 2);
       
   102     if (coverLabel)
       
   103         displayLayout->addWidget(coverLabel, 2);
       
   104     if (videoWidget)
       
   105         coverLabel->hide();          
       
   106 
       
   107     QBoxLayout *controlLayout = new QHBoxLayout;
       
   108     controlLayout->setMargin(0);
       
   109     controlLayout->addWidget(openButton);
       
   110     controlLayout->addStretch(1);
       
   111     controlLayout->addWidget(controls);
       
   112     controlLayout->addStretch(1);
       
   113 
       
   114     QBoxLayout *layout = new QVBoxLayout;
       
   115     layout->addLayout(displayLayout);
       
   116     layout->addWidget(slider);
       
   117     layout->addLayout(controlLayout);
       
   118     
       
   119     QWidget *centralWidget = new QWidget;
       
   120     centralWidget->setLayout(layout);
       
   121     setCentralWidget(centralWidget);
       
   122 
       
   123     createMenu();
       
   124     
       
   125     metaDataChanged();
       
   126     mediaKeysObserver = new MediaKeysObserver(this);
       
   127     connect(mediaKeysObserver, SIGNAL(mediaKeyPressed(MediaKeysObserver::MediaKeys)), this, SLOT(handleMediaKeyEvent(MediaKeysObserver::MediaKeys)));
       
   128 }
       
   129 
       
   130 
       
   131 
       
   132 S60Player::~S60Player()
       
   133 {
       
   134     delete playlist;
       
   135     delete player;   
       
   136     delete coverLabel;
       
   137 }
       
   138 
       
   139 void S60Player::open()
       
   140 {
       
   141     QStringList fileNames = QFileDialog::getOpenFileNames();
       
   142     foreach (QString const &fileName, fileNames)
       
   143         playlist->addMedia(QUrl::fromLocalFile(fileName));
       
   144 }
       
   145 
       
   146 void S60Player::addMediaToPlayList(const QString &url)
       
   147 {
       
   148 	playlist->addMedia(QUrl(url));
       
   149 	
       
   150 	playlist->setCurrentIndex(playlist->mediaCount() > 0 ? playlist->mediaCount()-1 : 0);
       
   151 }
       
   152 
       
   153 void S60Player::durationChanged(qint64 duration)
       
   154 {
       
   155     slider->setMaximum(duration / 1000);
       
   156 }
       
   157 
       
   158 void S60Player::positionChanged(qint64 progress)
       
   159 {
       
   160     slider->setValue(progress / 1000);
       
   161 }
       
   162 
       
   163 void S60Player::metaDataChanged()
       
   164 {
       
   165     if (player->isMetaDataAvailable()) {
       
   166         setTrackInfo(QString("(%1/%2) %3 - %4")
       
   167         		.arg(playlist->currentIndex()+1)
       
   168         		.arg(playlist->mediaCount())
       
   169                 .arg(player->metaData(QtMedia::AlbumArtist).toString())
       
   170                 .arg(player->metaData(QtMedia::Title).toString()));      
       
   171   
       
   172         if (coverLabel && !player->isVideoAvailable() ) {
       
   173             QUrl uri = player->metaData(QtMedia::CoverArtUrlLarge).value<QUrl>();
       
   174             if (uri.isEmpty()) {
       
   175                 QVariant picture = player->extendedMetaData("attachedpicture");    
       
   176                 QPixmap p = NULL;
       
   177                 QByteArray bytearray = NULL;
       
   178                 bool success = false;
       
   179                 if (!picture.isNull() && picture.canConvert<QByteArray>()) {                    
       
   180                     bytearray = picture.value<QByteArray>();
       
   181                     if (!bytearray.isNull()) 
       
   182                         success = p.loadFromData(bytearray);                   
       
   183                     if (success) {                                
       
   184                         coverLabel->setPixmap(!p.isNull()
       
   185                                 ? p
       
   186                                 : QPixmap());
       
   187                     }
       
   188                 }        
       
   189                 else {               
       
   190                     QUrl url = player->media().canonicalUrl();                    
       
   191                     QString album("/Album.jpg");
       
   192                     QString urli = url.path(); 
       
   193                     int i = urli.lastIndexOf("/");
       
   194                     QString path = urli.mid(1,i-1);                    
       
   195                     QString albumPath = path.append(album);                     
       
   196                     coverLabel->setPixmap(!albumPath.isEmpty()
       
   197                         ? QPixmap(albumPath)
       
   198                         : QPixmap());                        
       
   199                 }
       
   200             }
       
   201             else {
       
   202                 coverLabel->setPixmap(!uri.isEmpty()
       
   203                     ? QPixmap(uri.toString())
       
   204                     : QPixmap());            
       
   205             }                        
       
   206         }
       
   207     }
       
   208 }
       
   209 
       
   210 
       
   211 void S60Player::seek(int seconds)
       
   212 {
       
   213     player->setPosition(seconds * 1000);
       
   214 }
       
   215 
       
   216 void S60Player::setVisibleWidget()
       
   217 {
       
   218     if(!player->isVideoAvailable()) {
       
   219         if (!videoWidget->isHidden())
       
   220             videoWidget->hide();
       
   221         if (coverLabel->isHidden())
       
   222             coverLabel->show();           
       
   223     }
       
   224     else {
       
   225         if (!coverLabel->isHidden())
       
   226             coverLabel->hide();
       
   227         if (videoWidget->isHidden())
       
   228             videoWidget->show();            
       
   229     }       
       
   230     metaDataChanged();    
       
   231 }
       
   232 
       
   233 void S60Player::statusChanged(QMediaPlayer::MediaStatus status)
       
   234 {
       
   235     switch (status) {
       
   236     case QMediaPlayer::LoadedMedia:
       
   237         setStatusInfo(QString());    
       
   238         setVisibleWidget();
       
   239         player->play();
       
   240         break;
       
   241     case QMediaPlayer::UnknownMediaStatus:
       
   242     case QMediaPlayer::NoMedia:
       
   243     case QMediaPlayer::BufferingMedia:
       
   244     case QMediaPlayer::BufferedMedia:
       
   245 #ifndef QT_NO_CURSOR
       
   246         unsetCursor();
       
   247 #endif
       
   248         setStatusInfo(QString());
       
   249         break;
       
   250     case QMediaPlayer::LoadingMedia:
       
   251 #ifndef QT_NO_CURSOR
       
   252         setCursor(QCursor(Qt::BusyCursor));
       
   253 #endif
       
   254         setStatusInfo(tr("Loading..."));
       
   255         break;
       
   256     case QMediaPlayer::StalledMedia:
       
   257 #ifndef QT_NO_CURSOR
       
   258         setCursor(QCursor(Qt::BusyCursor));
       
   259 #endif
       
   260         break;
       
   261     case QMediaPlayer::EndOfMedia:
       
   262 #ifndef QT_NO_CURSOR
       
   263         unsetCursor();
       
   264 #endif
       
   265         setStatusInfo(QString());
       
   266         QApplication::alert(this);
       
   267         break;
       
   268     case QMediaPlayer::InvalidMedia:
       
   269 #ifndef QT_NO_CURSOR
       
   270         unsetCursor();
       
   271 #endif
       
   272         setStatusInfo(player->errorString());
       
   273         break;
       
   274     }
       
   275 }
       
   276 
       
   277 void S60Player::bufferingProgress(int progress)
       
   278 {
       
   279     setStatusInfo(tr("Buffering %4%%").arg(progress));
       
   280 }
       
   281 
       
   282 void S60Player::setTrackInfo(const QString &info)
       
   283 {
       
   284     trackInfo = info;
       
   285 
       
   286     if (!statusInfo.isEmpty())
       
   287         setWindowTitle(QString("%1 | %2").arg(trackInfo).arg(statusInfo));
       
   288     else
       
   289         setWindowTitle(trackInfo);
       
   290 
       
   291 }
       
   292 
       
   293 void S60Player::setStatusInfo(const QString &info)
       
   294 {
       
   295     statusInfo = info;
       
   296 
       
   297     if (!statusInfo.isEmpty())
       
   298         setWindowTitle(QString("%1 | %2").arg(trackInfo).arg(statusInfo));
       
   299     else
       
   300         setWindowTitle(trackInfo);
       
   301 }
       
   302 
       
   303 void S60Player::showColorDialog()
       
   304 {
       
   305     if (!colorDialog) {
       
   306         QSlider *brightnessSlider = new QSlider(Qt::Horizontal);
       
   307         brightnessSlider->setRange(-100, 100);
       
   308         brightnessSlider->setValue(videoWidget->brightness());
       
   309         connect(brightnessSlider, SIGNAL(sliderMoved(int)), videoWidget, SLOT(setBrightness(int)));
       
   310         connect(videoWidget, SIGNAL(brightnessChanged(int)), brightnessSlider, SLOT(setValue(int)));
       
   311 
       
   312         QSlider *contrastSlider = new QSlider(Qt::Horizontal);
       
   313         contrastSlider->setRange(-100, 100);
       
   314         contrastSlider->setValue(videoWidget->contrast());
       
   315         connect(contrastSlider, SIGNAL(sliderMoved(int)), videoWidget, SLOT(setContrast(int)));
       
   316         connect(videoWidget, SIGNAL(contrastChanged(int)), contrastSlider, SLOT(setValue(int)));
       
   317 
       
   318         QSlider *hueSlider = new QSlider(Qt::Horizontal);
       
   319         hueSlider->setRange(-100, 100);
       
   320         hueSlider->setValue(videoWidget->hue());
       
   321         connect(hueSlider, SIGNAL(sliderMoved(int)), videoWidget, SLOT(setHue(int)));
       
   322         connect(videoWidget, SIGNAL(hueChanged(int)), hueSlider, SLOT(setValue(int)));
       
   323 
       
   324         QSlider *saturationSlider = new QSlider(Qt::Horizontal);
       
   325         saturationSlider->setRange(-100, 100);
       
   326         saturationSlider->setValue(videoWidget->saturation());
       
   327         connect(saturationSlider, SIGNAL(sliderMoved(int)), videoWidget, SLOT(setSaturation(int)));
       
   328         connect(videoWidget, SIGNAL(saturationChanged(int)), saturationSlider, SLOT(setValue(int)));
       
   329 
       
   330         QFormLayout *layout = new QFormLayout;
       
   331         layout->addRow(tr("Brightness"), brightnessSlider);
       
   332         layout->addRow(tr("Contrast"), contrastSlider);
       
   333         layout->addRow(tr("Hue"), hueSlider);
       
   334         layout->addRow(tr("Saturation"), saturationSlider);
       
   335 
       
   336         colorDialog = new QDialog(this);
       
   337         colorDialog->setWindowTitle(tr("Color Options"));
       
   338         colorDialog->setLayout(layout);
       
   339     }
       
   340     colorDialog->show();    
       
   341 }
       
   342 
       
   343 void S60Player::handleMediaKeyEvent(MediaKeysObserver::MediaKeys key)
       
   344 {
       
   345     switch (key) {
       
   346         case MediaKeysObserver::EVolIncKey: 
       
   347             player->setVolume(player->volume() + 10);
       
   348             break;
       
   349         case MediaKeysObserver::EVolDecKey:
       
   350             player->setVolume(player->volume() - 10);
       
   351             break;
       
   352         default:
       
   353         break;
       
   354     }
       
   355 }
       
   356 
       
   357 void S60Player::createMenu()
       
   358 {
       
   359 	if (videoWidget) {
       
   360 		QAction* actionToggleFullscreen = menuBar()->addAction("Toggle fullscreen");
       
   361 		actionToggleFullscreen->setCheckable(true);
       
   362 		connect(actionToggleFullscreen, SIGNAL(triggered(bool)), videoWidget, SLOT(setFullScreen(bool)));
       
   363 		
       
   364 		QAction* actionColorAdjust = menuBar()->addAction("Color Adjust");
       
   365 		connect(actionColorAdjust, SIGNAL(triggered()), this, SLOT(showColorDialog()));
       
   366 	}
       
   367 	
       
   368     QAction *youtubeAction = menuBar()->addAction("Youtube search");
       
   369     connect(youtubeAction, SIGNAL(triggered()), this, SLOT(launchYoutubeDialog()));
       
   370 
       
   371 	rateMenu = menuBar()->addMenu(tr("Rate"));
       
   372 
       
   373 	signalMapper = new QSignalMapper(this);
       
   374 	QAction *menu_05Action = new QAction(tr("0.5x"), this);
       
   375 	connect(menu_05Action, SIGNAL(triggered()), signalMapper, SLOT(map()));
       
   376     signalMapper->setMapping(menu_05Action, "0.5");
       
   377 
       
   378     QAction *menu_10Action = new QAction(tr("1.0x"), this);
       
   379 	connect(menu_10Action, SIGNAL(triggered()), signalMapper, SLOT(map()));
       
   380     signalMapper->setMapping(menu_10Action, "1.0");
       
   381     
       
   382     QAction *menu_20Action = new QAction(tr("2.0x"), this);
       
   383 	connect(menu_20Action, SIGNAL(triggered()), signalMapper, SLOT(map()));
       
   384     signalMapper->setMapping(menu_20Action, "2.0");
       
   385 
       
   386     connect(signalMapper, SIGNAL(mapped(const QString &)),
       
   387             this, SLOT(updateRate(const QString &)));
       
   388     
       
   389     rateMenu->addAction(menu_05Action);
       
   390     rateMenu->addAction(menu_10Action);
       
   391     rateMenu->addAction(menu_20Action);
       
   392 }
       
   393 
       
   394 void S60Player::updateRate(const QString & rate)
       
   395 {
       
   396 	player->setPlaybackRate(rate.toFloat());
       
   397 }
       
   398 
       
   399 void S60Player::launchYoutubeDialog()
       
   400 {
       
   401     YoutubeDialog youtube(this);
       
   402     youtube.exec();    
       
   403 }
       
   404 
       
   405 YoutubeDialog::YoutubeDialog(S60Player *player)
       
   406     : QDialog(0), m_player(player) 
       
   407 {
       
   408     searchLine= new QLineEdit(this);
       
   409     QPushButton *searchButton = new QPushButton("Search");
       
   410     QHBoxLayout *topLayout = new QHBoxLayout;
       
   411     topLayout->addWidget(searchLine);
       
   412     topLayout->addWidget(searchButton);
       
   413     connect(searchButton, SIGNAL(clicked()), this, SLOT(search()));
       
   414     
       
   415 	videoList = new QListWidget(this);
       
   416     QPushButton *playButton = new QPushButton("Add");
       
   417     connect(playButton, SIGNAL(clicked()), this, SLOT(add()));
       
   418     QPushButton *closeButton = new QPushButton("Close");
       
   419     connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
       
   420     
       
   421     QHBoxLayout *bottomLayout = new QHBoxLayout;
       
   422     bottomLayout->addWidget(playButton);
       
   423     bottomLayout->addWidget(closeButton);
       
   424     
       
   425     QVBoxLayout *mainLayout = new QVBoxLayout;
       
   426     mainLayout->addLayout(topLayout);
       
   427     mainLayout->addWidget(videoList);
       
   428     mainLayout->addLayout(bottomLayout);
       
   429     
       
   430     setLayout(mainLayout);
       
   431     
       
   432     connect(&http, SIGNAL(requestFinished(int, bool)),
       
   433         this, SLOT(httpRequestFinished(int, bool)));
       
   434     connect(&http, SIGNAL(responseHeaderReceived(const QHttpResponseHeader&)),
       
   435         this, SLOT(readResponseHeader(const QHttpResponseHeader&)));
       
   436     
       
   437     showFullScreen(); 
       
   438 }
       
   439 
       
   440 void YoutubeDialog::readResponseHeader(const QHttpResponseHeader& responseHeader)
       
   441 {
       
   442     switch (responseHeader.statusCode())
       
   443     {
       
   444         case 200:   // Ok
       
   445         case 301:   // Moved Permanently
       
   446         case 302:   // Found
       
   447         case 303:   // See Other
       
   448         case 307:   // Temporary Redirect
       
   449         {
       
   450             // these are not error conditions
       
   451             break;
       
   452         }
       
   453         default:
       
   454         {
       
   455             QMessageBox::information(this, tr("Youtube"),
       
   456                 tr("Download failed: %1.").arg(responseHeader.reasonPhrase()));
       
   457             httpRequestAborted = true;
       
   458             http.abort();
       
   459         }
       
   460     }
       
   461 }
       
   462 
       
   463 void YoutubeDialog::add()
       
   464 {
       
   465 	qDebug() << videoList->currentRow();
       
   466 	qDebug() << videoNameList.at(videoList->currentRow());
       
   467 	qDebug() << videoNameList;
       
   468 	m_player->addMediaToPlayList(videoNameList.at(videoList->currentRow()));
       
   469 }
       
   470 
       
   471 void YoutubeDialog::search()
       
   472 {
       
   473 	QString searchText = searchLine->text().replace(' ', '+');
       
   474 	
       
   475 	QString urlstring = QString("http://gdata.youtube.com/feeds/api/videos?" \
       
   476 	     "q=%1&max-results=25&v=2&format=6").arg(searchText);
       
   477 	httpRequestAborted = false;
       
   478 	QUrl url(urlstring);
       
   479 	http.setHost(url.host(), QHttp::ConnectionModeHttp, url.port() == -1 ? 0 : url.port());   
       
   480 	videoList->clear();
       
   481 	videoNameList.clear();
       
   482 	httpGetId = http.get(urlstring);
       
   483 }
       
   484 
       
   485 void YoutubeDialog::httpRequestFinished(int requestId, bool error)
       
   486 {
       
   487     if (requestId != httpGetId || httpRequestAborted)
       
   488     {
       
   489         return;
       
   490     }
       
   491     
       
   492     if (error)
       
   493     {
       
   494         QMessageBox::information(this, tr("Youtube"),
       
   495             tr("Download failed: %1.")
       
   496             .arg(http.errorString()));
       
   497     }
       
   498     else
       
   499     {
       
   500 		QString data = http.readAll();
       
   501         QTextStream in(&data);
       
   502         QStringList lines;
       
   503         
       
   504         QTemporaryFile file;
       
   505         if (!file.open()) {	
       
   506 			QMessageBox::information(this, tr("Youtube"),
       
   507 					tr("Error"));
       
   508 			return;
       
   509         }
       
   510         
       
   511         QTextStream out(&file);
       
   512         
       
   513         while (!in.atEnd())
       
   514 		{
       
   515 			QString oneLine = in.readLine();
       
   516 			out << oneLine;
       
   517 			lines.append(oneLine);
       
   518 		}
       
   519         file.close();
       
   520         
       
   521         if (!file.open()) {	
       
   522 			QMessageBox::information(this, tr("Youtube"),
       
   523 					tr("Error"));
       
   524 			return;
       
   525         }
       
   526     	
       
   527 		QDomDocument domDocument;
       
   528 		QString errorMessage;
       
   529 		if (!domDocument.setContent(&file, true, &errorMessage)) {
       
   530 			return;
       
   531 		}
       
   532 
       
   533 		QDomElement root = domDocument.documentElement();
       
   534 		if (root.tagName() != "feed")
       
   535 			return;
       
   536 		
       
   537 		QDomElement entryElement = root.firstChildElement("entry");
       
   538 		
       
   539 		while(!entryElement.isNull()) 
       
   540 		{
       
   541 			QString title = entryElement.firstChildElement("title").text();
       
   542 			QDomElement groupElement = entryElement.firstChildElement("group");
       
   543 			QDomElement incidentElement2 = groupElement.firstChildElement("content");
       
   544 			while(!incidentElement2.isNull()) 
       
   545 			{
       
   546                 // "6" = MPEG-4 SP video (up to 176x144) and AAC audio.
       
   547 				if (incidentElement2.attribute("format") == "6") { 
       
   548 					videoList->addItem(title);
       
   549 					videoNameList.append(incidentElement2.attribute("url"));
       
   550 					break;
       
   551 				} 
       
   552 				incidentElement2 = incidentElement2.nextSiblingElement("content");
       
   553 			}
       
   554 			
       
   555 			entryElement = entryElement.nextSiblingElement("entry");
       
   556 		}
       
   557     }
       
   558 }
       
   559