jsbindings/jscontroller-jsbindings.cpp
/**
 * @brief Loads AAMP_JSController JS object into JS execution context
 *
 * @param[in] context JS execution context
 */
@brief Loads AAMP_JSController JS object into JS execution context
@param[in] context JS execution context
@brief Loads AAMP_JSController JS object into JS execution context @param [ in ] context JS execution context
void aamp_LoadJSController(JSGlobalContextRef context)
{
	INFO("[AAMP_JSController] aamp_LoadJSController context=%p\n", context);
	AAMP_JSController* aampObj = new AAMP_JSController();
	aampObj->_ctx = context;
	aampObj->_aampSessionID = 0;
	aampObj->_listeners.clear();
	aampObj->_licenseServerUrl = std::string();
	_globalController = aampObj;
	aamp_LoadJS(context, NULL);
	AAMPPlayer_LoadJS(context);
	JSClassRef classDef = JSClassCreate(&AAMP_JSController_class_def);
	JSObjectRef classObj = JSObjectMake(context, classDef, aampObj);
	JSObjectRef globalObj = JSContextGetGlobalObject(context);
	JSStringRef str = JSStringCreateWithUTF8CString("AAMP_JSController");
	JSObjectSetProperty(context, globalObj, str, classObj, kJSPropertyAttributeReadOnly, NULL);
	JSClassRelease(classDef);
	JSStringRelease(str);
}
void aamp_LoadJSController ( JSGlobalContextRef context ) { INFO ( " \n " , context ) ; AAMP_JSController * aampObj = new AAMP_JSController ( ) ; aampObj -> _ctx = context ; aampObj -> _aampSessionID = 0 ; aampObj -> _listeners . clear ( ) ; aampObj -> _licenseServerUrl = std :: string ( ) ; _globalController = aampObj ; aamp_LoadJS ( context , NULL ) ; AAMPPlayer_LoadJS ( context ) ; JSClassRef classDef = JSClassCreate ( & AAMP_JSController_class_def ) ; JSObjectRef classObj = JSObjectMake ( context , classDef , aampObj ) ; JSObjectRef globalObj = JSContextGetGlobalObject ( context ) ; JSStringRef str = JSStringCreateWithUTF8CString ( " " ) ; JSObjectSetProperty ( context , globalObj , str , classObj , kJSPropertyAttributeReadOnly , NULL ) ; JSClassRelease ( classDef ) ; JSStringRelease ( str ) ; }
@brief Loads AAMP_JSController JS object into JS execution context
 @param[in] context JS execution context
@brief Loads AAMP_JSController JS object into JS execution context @param [ in ] context JS execution context