- if(playing)
- {
- //reply->abort();
- }
- pd = new grooveProgressBar();
- //pd->setAttribute();
- pd->show();
- pd->setValue(0);
- QNetworkRequest req;
- req.setUrl(server);
- qDebug() << server;
- req.setHeader(req.ContentTypeHeader,QVariant("application/x-www-form-urlencoded"));
- reply = manager->post(req,QString("streamKey=" + StreamKey.toAscii()).toAscii());
- buffer->open(buffer->ReadWrite | buffer->Truncate);
- connect(reply,SIGNAL(finished()),this,SLOT(start()));
- connect(reply,SIGNAL(downloadProgress(qint64,qint64)),this,SLOT(putb(qint64,qint64)));
- //connect(pd,SIGNAL(canceled()),this,SLOT(abortDownload()));
- media->stop();
- playing = false;
- startStreamT = QTime::currentTime();
-}
-void sPlayer::start()
-{
- QVariant url = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
- if(url.toUrl().isValid())
- {
- QNetworkRequest req;
- req.setUrl(url.toUrl());
- qDebug() << url;
- reply = manager->get(req);
- connect(reply,SIGNAL(finished()),this,SLOT(start()));
- connect(reply,SIGNAL(downloadProgress(qint64,qint64)),this,SLOT(putb(qint64,qint64)));
- }
- else
- {
- if(!playing)