[Laszlo-dev] Closing Stream before browser is closed

Max Carlson max at openlaszlo.org
Wed Feb 17 10:36:33 PST 2010


Perhaps lps/components/extensions/av/rtmpconnection.l
zx needs a destroy() method that calls close()?

Regards,
Max Carlson
OpenLaszlo.org

On 2/17/10 10:23 AM, Lucas Lain wrote:
> Hello Everybody,
>
> I implemented this code, but the problem now is that RED5 throws an
> unexpected EOF Exception.
>
> I think the problem is that the flash component send the disconnect
> commands and is unloaded without waiting the response.
>
> ideas?
>
> Best.
>
> lucas.
>
> On Wed, Feb 17, 2010 at 3:02 PM, Lucas Lain<lucas.lain at gmail.com>  wrote:
>> This method worked ...
>>
>>>> <script type="text/javascript>window.beforeonunload=function(e) {
>>>>        value = lz.embed.lzapp.callMethod('canvas.shutdown()')
>>>> }
>>>> </script>
>>
>> But this do not:
>>
>>>> <script type="text/javascript>window.beforeonunload=function(e) {
>>>>        value = lz.embed.callMethod('canvas.shutdown()')
>>>> }
>>>> </script>
>>
>> Best!
>>
>> Lucas.
>>
>>>> Regards,
>>>> Max Carlson
>>>> OpenLaszlo.org
>>>>
>>>> On 2/17/10 4:54 AM, Lucas Lain wrote:
>>>>>
>>>>> Hello Max,
>>>>>
>>>>> Thank you for your answer. Let me see If I got you straight
>>>>>
>>>>> I should use something like this in the html:
>>>>>
>>>>> <script type="text/javascript>window.beforeonunload=function(e) {
>>>>>        value =
>>>>> lz.embed.lzapp.callMethod('globalreference.reference.shutdown()')
>>>>> }
>>>>> </script>
>>>>>
>>>>> And implement the "shutdown" method on my canvas?
>>>>>
>>>>> Thanks in advance.
>>>>>
>>>>> Lucas.
>>>>>
>>>>>
>>>>> On Tue, Feb 16, 2010 at 7:47 PM, Max Carlson<max at openlaszlo.org>    wrote:
>>>>>>
>>>>>> Hi Lucas,
>>>>>>
>>>>>> It sounds like the platform should include a workaround for this - can
>>>>>> you
>>>>>> file an improvement request in http://jira.openlaszlo.org/ ?
>>>>>>
>>>>>> In the mean time, you should be able to call into your app with the
>>>>>> callMethod() or setCanvasAttribute() APIs documented here:
>>>>>>
>>>>>> http://labs.openlaszlo.org/trunk-nightly/my-apps/copy-of-hello.lzx?lzr=swf8&lzt=deployment
>>>>>>
>>>>>> I'd probably create a canvas method that iterates through the currently
>>>>>> open
>>>>>> connections and calls close on them.
>>>>>>
>>>>>> Just click the 'Server' button in the dev console to get details.  Let me
>>>>>> know if you have questions!
>>>>>>
>>>>>> Regards,
>>>>>> Max Carlson
>>>>>> OpenLaszlo.org
>>>>>>
>>>>>> On 2/16/10 9:03 AM, Lucas Lain wrote:
>>>>>>>
>>>>>>> Hello everybody,
>>>>>>>
>>>>>>> Looking on the web, I found this solution to implement the
>>>>>>> NetConnection shutdown before the browser window is closed.
>>>>>>>
>>>>>>> I'm trying to modify mediastream.lzx to include the actionscript part,
>>>>>>> so I can reuse it in the future (maybe you can include it in the next
>>>>>>> version)
>>>>>>>
>>>>>>> The thing is I don't know where I can insert the "exShutDown" function.
>>>>>>>
>>>>>>> Any ideas? max?
>>>>>>>
>>>>>>> in actionscript:
>>>>>>>
>>>>>>> import flash.external.Externalnterface();
>>>>>>> ExternalInterface.addCallback("shutdown",exShutdown);
>>>>>>> public function exShutDown():void {
>>>>>>>             your-net-connection.close();
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> So I can use in the serving webpage:
>>>>>>>
>>>>>>> <script type="text/javascript>window.beforeonunload=function(e) {
>>>>>>>        document.getElementById("whateveryoucallit").shutdown();
>>>>>>> }
>>>>>>> </script>
>>>>>>>
>>>>>>>
>>>>>>> Thanks in advance.
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Lucas
>>>
>>
>>
>>
>> --
>> Lucas
>>
>
>
>


More information about the Laszlo-dev mailing list