[SWFObject] Problem with SWFObject, ExternalInterface and Microsoft Windows Media Center

Geoff Stearns geoff at deconcept.com
Wed Nov 15 14:26:34 PST 2006


yeah, sounds like that will do it.


On Nov 15, 2006, at 5:16 PM, Kareem Kouddous wrote:

> I play WMV through the custom viewport in the MCE but use the same  
> SWF to play FLV video in a regular browser. I have not experienced  
> the audio issue with FLVs but now that I understand the problem  
> better I think it should be pretty easy to only override the  
> function if you are in the MCE by checking  
> window.external.MediaCenter.
>
> On Nov 15, 2006, at 4:40 PM, Geoff Stearns wrote:
>
>> well, so it seems that the onbeforeunload is being triggered when  
>> you return to the page (or when you leave it) and that's what is  
>> killing the swf...
>>
>> since you removed that code, you may find that if you have a video  
>> playing, and you leave the page, the audio may continue for that  
>> video...
>>
>> are you using flv video in the MCE app? (our experience with this  
>> was bad since it looks like crap on extenders - ms generally won't  
>> let you do that if you want your app to appear in their online  
>> spotlight area)
>>
>> but your solution to take out the code is certainly a viable fix  
>> if you don't see any side effects with your streaming flv videos.  
>> As I said before, flash player 9 inserts similary functions, so  
>> the trick is to remove those but not replace them with the custom  
>> code in swfobject.
>>
>>
>>
>>
>>
>> On Nov 15, 2006, at 12:51 PM, Kareem Kouddous wrote:
>>
>>> Thanks Geoff.
>>>
>>> I removed the lines below from the swfobject.js and it fixed the  
>>> problem. What do you suggest I do going forward? I wish I had the  
>>> cycles to try and research and fix the problem but unfortunately  
>>> I don't. I was thinking that a temporary band-aid is to leave  
>>> these lines removed locally and manually merge any updates to  
>>> swfobject until this problem is resolved. Do you see any issues  
>>> with this? I only use swf on my page but I do steam FLV video.
>>>
>>> // fixes bug in fp9 see http://blog.deconcept.com/2006/07/28/ 
>>> swfobject-143-released/
>>> deconcept.SWFObjectUtil.prepUnload = function() {
>>> 	__flash_unloadHandler = function(){};
>>> 	__flash_savedUnloadHandler = function(){};
>>> 	if (typeof window.onunload == 'function') {
>>> 		var oldUnload = window.onunload;
>>> 		window.onunload = function() {
>>> 			deconcept.SWFObjectUtil.cleanupSWFs();
>>> 			oldUnload();
>>> 		}
>>> 	} else {
>>> 		window.onunload = deconcept.SWFObjectUtil.cleanupSWFs;
>>> 	}
>>> }
>>> if (typeof window.onbeforeunload == 'function') {
>>> 	var oldBeforeUnload = window.onbeforeunload;
>>> 	window.onbeforeunload = function() {
>>> 		deconcept.SWFObjectUtil.prepUnload();
>>> 		oldBeforeUnload();
>>> 	}
>>> } else {
>>> 	window.onbeforeunload = deconcept.SWFObjectUtil.prepUnload;
>>> }
>>>
>>>
>>> On Nov 14, 2006, at 8:43 PM, Geoff Stearns wrote:
>>>
>>>> Well, I've used SWFObject in a couple of MCE apps, and all has  
>>>> been fine.. but I'm not sure than any of them use the  
>>>> customviewport to show fullscreen stuff, though.
>>>>
>>>> That article that you linked made me think of something though:
>>>>
>>>> In FP9, some code was added in to 'clean up' the swfs on the  
>>>> page when the page unloads - if you are using external  
>>>> interface, the Flash player inserts a function in the page... I  
>>>> actually ended up rewriting the functions with SWFObject because  
>>>> they are a little buggy - if you have more than one swf on the  
>>>> page you get an out of memory error... but anyway...
>>>>
>>>> what may work is this: try overwriting the functions that are  
>>>> inserted into the page - you can see how to do this if you look  
>>>> at the current swfobject code (ceck the uncompressed version) -  
>>>> this replaces the functions with my own, but you could just  
>>>> replace them with empty functions and see if that fixes it...  
>>>> the white screen might be the leftover space that the swf is  
>>>> taking up after their special script unloads it.
>>>>
>>>> let me know if that doesn't fix it... i'm actually installing  
>>>> MCE in parallels right now to do some testing of our old apps  
>>>> (and I seem to remember another bug we had in a new MCE app  
>>>> that's just about finished).
>>>>
>>>>
>>>>
>>>>
>>>> On Nov 14, 2006, at 3:24 PM, Kareem Kouddous wrote:
>>>>
>>>>> Hi All,
>>>>>
>>>>> I am having a problem with an HTML Media Center Application  
>>>>> (like MTV's Overdrive or Comedy Central's Motherload) using  
>>>>> SWFObject to embed a flash movie that uses ExternalInterface.  
>>>>> My application uses the Custom Viewport to play video and if  
>>>>> you go fullscreen and then try and go back to the application  
>>>>> the flash movie disappears and is replaced with white background.
>>>>>
>>>>> - This may be related to this problem - http:// 
>>>>> blog.metawrap.com/blog/ 
>>>>> externalInterfaceUnderFlashPlayer9IsEvilTheWhiteScreenOfDeath.aspx
>>>>> - The problem occurs even if the swfobject.js is included in  
>>>>> the page but not used (as long as ExternalInterface is used for  
>>>>> javascript to flash communication).
>>>>>
>>>>> Has anyone else experienced this problem? If so, are there any  
>>>>> known workarounds (apart from going back to my custom way of  
>>>>> embedding the flash movie)? Any help would be greatly appreciated.
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Kareem
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> SWFObject mailing list
>>>>> SWFObject at lists.deconcept.com
>>>>> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
>>>>
>>>> _______________________________________________
>>>> SWFObject mailing list
>>>> SWFObject at lists.deconcept.com
>>>> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
>>>
>>> _______________________________________________
>>> SWFObject mailing list
>>> SWFObject at lists.deconcept.com
>>> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
>>
>> _______________________________________________
>> SWFObject mailing list
>> SWFObject at lists.deconcept.com
>> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com
>
> _______________________________________________
> SWFObject mailing list
> SWFObject at lists.deconcept.com
> http://lists.deconcept.com/listinfo.cgi/swfobject-deconcept.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.deconcept.com/pipermail/swfobject-deconcept.com/attachments/20061115/84ce11f5/attachment-0005.htm>


More information about the Swfobject mailing list