libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libmicrohttpd] Stopping MJPEG streams


From: Christian Grothoff
Subject: Re: [libmicrohttpd] Stopping MJPEG streams
Date: Wed, 9 Feb 2011 09:39:43 +0100
User-agent: KMail/1.13.5 (Linux/2.6.32-trunk-vserver-amd64; KDE/4.4.5; x86_64; ; )

On Tuesday 08 February 2011 19:38:10 David J Myers wrote:
> Hi,
> 
> I'm having some trouble with my streaming MJPEG webserver. It's basically
> about how a client webpage can cause the stream to stop and trigger the
> MHD_Content_Reader_free_Callback.
> 
> 
> 
> The webserver uses MHD_create_response_from callback with MHD_SIZE_UNKNOWN,
> and the Daemon is set for 2 second client timeouts.
> 
> 
> 
> So the webpage starts the stream with this line of html.
> 
> 
> 
>     <td rowspan="2" align="center" valign="top" style="border-right:dashed
> 1px grey;"><div id="div1" style="width:640px; height:480px; border:solid
> 1px red; position:relative; left:0px"><img src="mjpg/video.cgi?view=1"
> name="main1" /> </div>

Hi David,

Philipp Toelke suggests putting "video" instead of "img" in the HTML.  
Personally, IDK (this is more a browser/JavaScript issue than an HTTP/MHD 
issue). On the server side, you may be able to detect the request to 'blank' 
and stop sending, but I don't think that would be clean.

Happy hacking,

-Christian
 
> 
> 
> Then there is a button on the webpage to stop the video, which causes this
> javascript function to execute
> 
> 
> 
> function stop()
> 
> {
> 
>        eval('document.main1.src="images/blank.jpg"');
> 
> }
> 
> 
> 
> The blank jpeg is drawn into the div, but the webserver continues to stream
> the video and the reader free callback isn't triggered.
> 
> 
> 
> Does anyone know how I can stop the stream without totally navigating away
> from the page?
> 
> 
> 
> Thanks and regards
> 
> 
> 
> David Myers



reply via email to

[Prev in Thread] Current Thread [Next in Thread]