[Qt-interest] Phonon - Play back a downloading video file

Jonathan Wong jhannwong at gmail.com
Wed May 20 19:55:40 CEST 2009


Just tried it.

Was able to append to file while playing back the video. However, total time doesn't change with
new data written to file.

Richard wrote:
> Did you try to create a MediaSource from a QIODevice?
> 
> E.g like this:
> 
> #include <QtGui>
> #include <Phonon>
> 
> using namespace Phonon;
> 
> int main(int argc, char **argv){
>      QApplication app(argc, argv);
>      MediaObject mediaObject;
> 
>      VideoWidget vw;
>      vw.show();
> 
>      createPath(&mediaObject, &vw);
>      createPath(&mediaObject, new AudioOutput);
> 
>      QFile file(QFileDialog::getOpenFileName());
>      mediaObject.setCurrentSource(&file);
>      mediaObject.play();
> 
>      return app.exec();
> }
> 
> -Richard
> 
> 
> Den May 20, 2009 kl. 11:29 AM skrev Jonathan Wong:
> 
>> Hi Andy,
>>
>> Don't you need to close the 6MB file before you do a setSource?
>>
>> Of course, it'll be marvelous if I could setSource while still  
>> appending to the same video file.
>>
>> I just tried it myself. MediaObject is unable to load a video file  
>> if it is not closed. And I
>> can't open a video file for appending if MediaObject had already  
>> loaded it for playing.
>>
>> Andy Bell wrote:
>>> Hi Jonathan,
>>>
>>> I guess it may be important here to mention that I am using Qt  
>>> 4.4.0 on
>>> Windows XP.
>>>
>>> The video files are pretty large, like 700MB, what I find is that  
>>> after
>>> say 6MB of download the video files plays back fine.  This is  
>>> obviously
>>> all dependent on bitrate and the download rate but it seems to work
>>> fine.  I will try out that signal to see if I can work the player  
>>> to run
>>> smoothly on higher bitrates and/or slower connection speeds.
>>>
>>> Andy
>>>
>>> On Wed, May 20, 2009 at 6:08 AM, Jonathan Wong <jhannwong at gmail.com
>>> <mailto:jhannwong at gmail.com>> wrote:
>>>
>>>    Andy,
>>>
>>>    My colleague tried it. Did a MediaObject.setSource(), but failed  
>>> to
>>>    open the file again. Opening
>>>    the file first will cause setSource() to fail.
>>>
>>>    How did you play a video file while it is still open for  
>>> appending?
>>>
>>>    Jonathan Wong wrote:
>>>> Wow, one of my staff told me that wasn't possible, playing video
>>>    file while still appending to it.
>>>> Thanks for the heads up!
>>>>
>>>> (Sorry, repost. Sent to Andy privately before. The Reply-to
>>>    doesn't seem to be the list address.)
>>>> Andy Bell wrote:
>>>>> Hi All,
>>>>>
>>>>> I would like to playback a video via Phonon whilst I am actually
>>>>> downloading the video.  I can open the video file and play it back
>>>>> whilst it is downloading but I would like to be able to have the
>>>    player
>>>>> pause when it reaches the end of the already downloaded video so  
>>>>> that
>>>>> more video can be buffered and played back.  Is this possible?
>>>     If so,
>>>>> what do I need to do to accomplish this with Phonon?
>>>>>
>>>>> Thanks in advance.
>>>>>
>>>>> Andy Bell
>>>>>
>>>>>
>>>>>
>>>>>
>>>     
>>> ------------------------------------------------------------------------
>>>>> _______________________________________________
>>>>> Qt-interest mailing list
>>>>> Qt-interest at trolltech.com <mailto:Qt-interest at trolltech.com>
>>>>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>>>>
>>>    _______________________________________________
>>>    Qt-interest mailing list
>>>    Qt-interest at trolltech.com <mailto:Qt-interest at trolltech.com>
>>>    http://lists.trolltech.com/mailman/listinfo/qt-interest
>>>
>>>
>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Qt-interest mailing list
>>> Qt-interest at trolltech.com
>>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 




More information about the Qt-interest-old mailing list