Commit e333ac8d authored by Anssi Piirainen's avatar Anssi Piirainen
Browse files

hack to fix a namespace conflict with the JSON parser now included in the Flex...

hack to fix a namespace conflict with the JSON parser now included in the Flex SDK. I want to keep it using our patched JSON parser instead of the Flex one.
parent dcbf3519
......@@ -15,7 +15,7 @@ site.dir=/Users/api/hyde/site
js.deploy.dir=${site.dir}/deploy/js
deploy.dir=${site.dir}/content/swf
plugin.buildfiles=controls/build.xml,bwcheck/build.xml,f4m/build.xml,httpstreaming/build.xml
plugin.buildfiles=viralvideos/build.xml
jsplugins.buildfiles=controls/build.xml,embed/build.xml,ipad/build.xml,playlist/build.xml,bitrateselect/build.xml
......
......@@ -47,7 +47,7 @@ package com.adobe.serialization.json {
* var myObject:Object = JSON.decode( jsonString );
* </code>
*/
public class JSON {
public class JSONforFP {
/**
......
......@@ -18,6 +18,6 @@
<component id="URLUtil" class="org.flowplayer.util.URLUtil" />
<component id="Animation" class="org.flowplayer.view.AnimationEngine" />
<component id="Log" class="org.flowplayer.util.Log" />
<component id="JSON" class="com.adobe.serialization.json.JSON" />
<component id="JSON" class="com.adobe.serialization.json.JSONforFP" />
<!--<component id="Log" class="org.flowplayer.view.FlowplayerComponent" />-->
</componentPackage>
......@@ -21,7 +21,7 @@ package org.flowplayer.config {
import org.flowplayer.controller.ResourceLoader;
import org.flowplayer.flow_internal;
import org.flowplayer.util.Log;
import com.adobe.serialization.json.JSON;
import com.adobe.serialization.json.JSONforFP;
use namespace flow_internal;
......@@ -33,12 +33,12 @@ package org.flowplayer.config {
flow_internal static function parse(config:String):Object {
//#590 add full package reference to work with Flex 4.6
return com.adobe.serialization.json.JSON.decode(config);
return com.adobe.serialization.json.JSONforFP.decode(config);
}
flow_internal static function parseConfig(config:Object, builtInConfig:Object, playerSwfUrl:String, controlsVersion:String, audioVersion:String):Config {
if (!config) return new Config({}, builtInConfig, playerSwfUrl, controlsVersion, audioVersion);
var configObj:Object = config is String ? com.adobe.serialization.json.JSON.decode(config as String) : config;
var configObj:Object = config is String ? com.adobe.serialization.json.JSONforFP.decode(config as String) : config;
return new Config(configObj, builtInConfig, playerSwfUrl, controlsVersion, audioVersion);
}
......
......@@ -8,7 +8,7 @@
* http://www.opensource.org/licenses/mit-license.php
*/
package org.flowplayer.viralvideos {
import com.adobe.serialization.json.JSON;
import com.adobe.serialization.json.JSONforFP;
import flash.display.Sprite;
import flash.events.Event;
......@@ -353,7 +353,7 @@ package org.flowplayer.viralvideos {
var data:Object = null;
try {
data = JSON.decode(loader.data.toString());
data = JSONforFP.decode(loader.data.toString());
} catch(e:Error) {
}
......
......@@ -9,7 +9,7 @@
* Additional Term, see http://flowplayer.org/license_gpl.html
*/
package org.flowplayer.viralvideos {
import com.adobe.serialization.json.JSON;
import com.adobe.serialization.json.JSONforFP;
import flash.display.Stage;
import flash.net.URLVariables;
......@@ -110,8 +110,7 @@ package org.flowplayer.viralvideos {
if (configObj && String(configObj).indexOf("{") > 0 && ! configObj.hasOwnProperty("url")) {
// a regular configuration object
_playerConfig = JSON.decode(configObj);
_playerConfig = JSONforFP.decode(configObj);
} else {
// had an external config file configured using 'url', use the loaded config object
//_playerConfig = _player.config.configObject;
......@@ -229,7 +228,7 @@ package org.flowplayer.viralvideos {
var configStr:String = _embedConfig.configUrl;
if (! configStr) {
var conf:Object = updateConfig(_playerConfig);
configStr = escaped ? escape(JSON.encode(conf)) : JSON.encode(conf);
configStr = escaped ? escape(JSONforFP.encode(conf)) : JSONforFP.encode(conf);
}
return configStr;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment