[prev in list] [next in list] [prev in thread] [next in thread]
List: helix-datatype-cvs
Subject: [Datatype-cvs] flash/flashhost/platform/win32
From: ehyche () helixcommunity ! org
Date: 2007-04-27 0:56:25
Message-ID: 200704270056.l3R0uYmj016916 () mailer ! progressive-comp ! com
[Download RAW message or body]
Update of /cvsroot/datatype/flash/flashhost/platform/win32
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv25604/platform/win32
Modified Files:
Tag: hxclient_2_0_4_cayenne
flash_guest_player_ax.cpp
Log Message:
Merge from HEAD.
Description
------------------------------------------
In the ActiveX-based Flash guest player, we use an ATL-generated
wrapper around the ActiveX control. The ATL wrapper throws
exceptions when calls to the ActiveX fail. But we generally
don't handle exceptions in Helix code. Therefore,
the change first disables the call which would trigger
exceptions in the ATL wrapper (_com_issue_errorex) by
replacing it with our own null version.
Secondly, this change checks the Flash player version
and does not call methods which are not supported
by that version of the player. Practically, this
just affects a few calls (CallFunction() and DisableLocalSecurity()).
Also, the call to GetAllowNetworking() was removed, since
the result was not used anywhere.
Files Modified
------------------------------------------
datatype/flash/flashhost/platform/win32/flash_guest_player_ax.cpp
datatype/flash/flashhost/pub/platform/win32/flash.tli
datatype/flash/flashhost/pub/platform/win32/flash_guest_player_ax.h
Branches
------------------------------------------
HEAD, 150Cay, 204Cay
Testing
------------------------------------------
Smoke-tested transcoding and .swf playback after this change
Index: flash_guest_player_ax.cpp
===================================================================
RCS file: /cvsroot/datatype/flash/flashhost/platform/win32/flash_guest_player_ax.cpp,v
retrieving revision 1.10.2.2.2.2
retrieving revision 1.10.2.2.2.3
diff -u -d -r1.10.2.2.2.2 -r1.10.2.2.2.3
--- flash_guest_player_ax.cpp 26 Apr 2007 16:58:05 -0000 1.10.2.2.2.2
+++ flash_guest_player_ax.cpp 27 Apr 2007 00:56:23 -0000 1.10.2.2.2.3
@@ -84,6 +84,37 @@
HXBOOL SaveBitmap(HDC hDC, HBITMAP hBitmap, const char* szPath);
#endif
+// The current methods we may call in the Flash Player ActiveX control
+// are as follows, with corresponding minimum versions required.
+// The minimum versions required start at 6, since that is the
+// earliest version of the Flash player we reasonably expect
+// to encounter. Some of the methods may actually be supported back
+// to Flash 2 or 3.
+//
+// Method Minimum Version
+// ---------------------------------------
+// Stop 6
+// PercentLoaded 6
+// Play 6
+// StopPlay 6
+// CurrentFrame 6
+// TotalFrames 6
+// GotoFrame 6
+// FlashVersion 6
+// PutBackgroundColor 6
+// PutEmbedMovie 6
+// PutScale 6
+// PutLoop 6
+// PutAllowScriptAccess 6
+// PutWMode 6
+// PutMenu 6
+// LoadMovie 6
+// SetVariable 6
+// DisableLocalSecurity 8
+// CallFunction 8
+// GetAllowNetworking 9
+//
+
CFlashGuestPlayerAX::CFlashGuestPlayerAX()
: m_pFlashPlayer(NULL)
, m_pSite(NULL)
@@ -102,6 +133,7 @@
, m_pFileObject(NULL)
, m_dFrameRate(0.0)
, m_bInPlaceActive(FALSE)
+ , m_lFlashVersion(0)
, m_pOffscreenBuffer(NULL)
, m_hTempWindow(NULL)
, m_hwndParent(NULL)
@@ -1365,6 +1397,10 @@
if (SUCCEEDED(hres))
{
+ // Get the flash version
+ m_pFlashPlayer->raw_FlashVersion(&m_lFlashVersion);
+ // Shift down by 16 bits to get the major version
+ m_lFlashVersion >>= 16;
// Set up the flash presentation parameters
m_pFlashPlayer->PutBackgroundColor(0x00000000); // makes transparent \
background black, in helix m_pFlashPlayer->PutEmbedMovie(FALSE);
@@ -1380,7 +1416,7 @@
m_pFlashPlayer->PutWMode(L"windowed");
}
- if (!m_bLocalSecurityDisabled)
+ if (!m_bLocalSecurityDisabled && m_lFlashVersion >= 8)
{
try {
m_pFlashPlayer->DisableLocalSecurity();
@@ -2047,19 +2083,23 @@
HX_RESULT hr=HXR_FAIL;
- // use try/catch to avoid exceptions thrown if the CallFunction fails
- _bstr_t bstrResponse;
- try {
- _bstr_t bstrRequest = (const char*) strInvokeXML;
- bstrResponse = m_pFlashPlayer->CallFunction(bstrRequest);
- hr = HXR_OK;
- if (bstrResponse.length() > 0)
+ // CallFunction() is only supported on Flash version 8 and later
+ if (m_lFlashVersion >= 8)
+ {
+ // use try/catch to avoid exceptions thrown if the CallFunction fails
+ _bstr_t bstrResponse;
+ try {
+ _bstr_t bstrRequest = (const char*) strInvokeXML;
+ bstrResponse = m_pFlashPlayer->CallFunction(bstrRequest);
+ hr = HXR_OK;
+ if (bstrResponse.length() > 0)
+ {
+ HXLOGL4(HXLOG_FPHR, "CFlashGuestPlayerAX::FlashCall CallFunction \
response: %s", (const char*) bstrResponse); + }
+ } catch (...)
{
- HXLOGL4(HXLOG_FPHR, "CFlashGuestPlayerAX::FlashCall CallFunction \
response: %s", (const char*) bstrResponse); + HXLOGL4(HXLOG_FPHR, \
"CFlashGuestPlayerAX::FlashCall CallFunction FAILED"); }
- } catch (...)
- {
- HXLOGL4(HXLOG_FPHR, "CFlashGuestPlayerAX::FlashCall CallFunction FAILED");
}
// If ExternalInterface.call failed, use the watch variable 'HelixCommand' to \
call the AS function @@ -2088,8 +2128,7 @@
strHelixCommand += strInvokeArgs;
_bstr_t bstrRequest = (const char*) strHelixCommand;
- m_pFlashPlayer->SetVariable("HelixCommand", bstrRequest);
- hr = HXR_OK;
+ hr = m_pFlashPlayer->SetVariable("HelixCommand", bstrRequest);
} catch (...)
{
hr = HXR_FAIL;
_______________________________________________
Datatype-cvs mailing list
Datatype-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/datatype-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic