[vlc-commits] ActiveX: accept some tags like NPAPI

Jean-Baptiste Kempf git at videolan.org
Sat Aug 2 21:29:58 CEST 2014


npapi-vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Aug  2 21:28:39 2014 +0200| [fa985c4353fe2972caa046a3f0ee64ff11680d72] | committer: Jean-Baptiste Kempf

ActiveX: accept some tags like NPAPI

Notably controls and target

Ref #11487

> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=fa985c4353fe2972caa046a3f0ee64ff11680d72
---

 activex/persistpropbag.cpp |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/activex/persistpropbag.cpp b/activex/persistpropbag.cpp
index f0f842e..eb0be5c 100644
--- a/activex/persistpropbag.cpp
+++ b/activex/persistpropbag.cpp
@@ -79,6 +79,15 @@ STDMETHODIMP VLCPersistPropertyBag::Load(LPPROPERTYBAG pPropBag, LPERRORLOG pErr
                 _p_instance->setMRL(V_BSTR(&value));
                 VariantClear(&value);
             }
+            else
+            {
+                V_VT(&value) = VT_BSTR;
+                if( S_OK == pPropBag->Read(OLESTR("target"), &value, pErrorLog) )
+                {
+                    _p_instance->setMRL(V_BSTR(&value));
+                    VariantClear(&value);
+                }
+            }
         }
     }
 
@@ -107,6 +116,18 @@ STDMETHODIMP VLCPersistPropertyBag::Load(LPPROPERTYBAG pPropBag, LPERRORLOG pErr
         _p_instance->setShowToolbar(V_BOOL(&value) != VARIANT_FALSE);
         VariantClear(&value);
     }
+    else
+    {
+        /*
+        ** try alternative syntax
+        */
+        V_VT(&value) = VT_BOOL;
+        if( S_OK == pPropBag->Read(OLESTR("controls"), &value, pErrorLog) )
+        {
+            _p_instance->setShowToolbar(V_BOOL(&value) != VARIANT_FALSE);
+            VariantClear(&value);
+        }
+    }
 
     SIZEL size = _p_instance->getExtent();
     V_VT(&value) = VT_I4;
@@ -218,6 +239,27 @@ STDMETHODIMP VLCPersistPropertyBag::Load(LPPROPERTYBAG pPropBag, LPERRORLOG pErr
         _p_instance->get_options().set_enable_fs(V_BOOL(&value) != VARIANT_FALSE);
         VariantClear(&value);
     }
+    else
+    {
+        /*
+        ** try alternative syntax
+        */
+        V_VT(&value) = VT_BOOL;
+        if( S_OK == pPropBag->Read(OLESTR("allowfullscreen"), &value, pErrorLog) )
+        {
+            _p_instance->get_options().set_enable_fs(V_BOOL(&value) != VARIANT_FALSE);
+            VariantClear(&value);
+        }
+        else
+        {
+            V_VT(&value) = VT_BOOL;
+            if( S_OK == pPropBag->Read(OLESTR("fullscreen"), &value, pErrorLog) )
+            {
+                _p_instance->get_options().set_enable_fs(V_BOOL(&value) != VARIANT_FALSE);
+                VariantClear(&value);
+            }
+        }
+    }
 
     return _p_instance->onLoad();
 };



More information about the vlc-commits mailing list