jsbindings/jscontroller-jsbindings.cpp
/**
 * @brief Callback from JS to set a license server URL
 *
 * @param[in] context JS execution context
 * @param[in] function JSObject that is the function being called
 * @param[in] thisObject JSObject that is the 'this' variable in the function's scope
 * @param[in] argumentCount number of args
 * @param[in] arguments[] JSValue array of args
 * @param[out] exception pointer to a JSValueRef in which to return an exception, if any
 *
 * @retval JSValue that is the function's return value
 */


@retval JSValue that is the function's return value
@retval JSValue that is the function ' s return value
static JSValueRef AAMPJSC_setLicenseServerUrl(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef *exception)
{
	LOG("[AAMP_JSController] %s()", __FUNCTION__);
	AAMP_JSController *aampObj = (AAMP_JSController *)JSObjectGetPrivate(thisObject);
	if (aampObj == NULL)
	{
		*exception = aamp_GetException(context, AAMPJS_MISSING_OBJECT, "Can only call AAMP_JSController.setLicenseServerUrl on instances of AAMP_JSController");
		return JSValueMakeUndefined(context);
	}
	if (argumentCount == 1)
	{
		char *url = aamp_JSValueToCString(context, arguments[0], exception);
		if (strlen(url) > 0)
		{
			aampObj->_licenseServerUrl = std::string(url);
			if (aampObj->_aamp != NULL)
			{
				aampObj->_aamp->SetLicenseServerURL(aampObj->_licenseServerUrl.c_str());
			}
		}
		delete[] url;
	}
	else
	{
		*exception = aamp_GetException(context, AAMPJS_INVALID_ARGUMENT, "Failed to execute 'AAMP_JSController.setLicenseServerURL' - 1 argument required");
	}
	return JSValueMakeUndefined(context);
}
static JSValueRef AAMPJSC_setLicenseServerUrl ( JSContextRef context , JSObjectRef function , JSObjectRef thisObject , size_t argumentCount , const JSValueRef arguments [ ] , JSValueRef * exception ) { LOG ( " " , __FUNCTION__ ) ; AAMP_JSController * aampObj = ( AAMP_JSController * ) JSObjectGetPrivate ( thisObject ) ; if ( aampObj == NULL ) { * exception = aamp_GetException ( context , AAMPJS_MISSING_OBJECT , " " ) ; return JSValueMakeUndefined ( context ) ; } if ( argumentCount == 1 ) { char * url = aamp_JSValueToCString ( context , arguments [ 0 ] , exception ) ; if ( strlen ( url ) > 0 ) { aampObj -> _licenseServerUrl = std :: string ( url ) ; if ( aampObj -> _aamp != NULL ) { aampObj -> _aamp -> SetLicenseServerURL ( aampObj -> _licenseServerUrl . c_str ( ) ) ; } } delete [ ] url ; } else { * exception = aamp_GetException ( context , AAMPJS_INVALID_ARGUMENT , " " ) ; } return JSValueMakeUndefined ( context ) ; }
@brief Callback from JS to set a license server URL
 @param[in] context JS execution context
 @param[in] function JSObject that is the function being called
 @param[in] thisObject JSObject that is the 'this' variable in the function's scope
 @param[in] argumentCount number of args
 @param[in] arguments[] JSValue array of args
 @param[out] exception pointer to a JSValueRef in which to return an exception, if any
@brief Callback from JS to set a license server URL @param [ in ] context JS execution context @param [ in ] function JSObject that is the function being called @param [ in ] thisObject JSObject that is the ' this ' variable in the function ' s scope @param [ in ] argumentCount number of args @param [ in ] arguments [] JSValue array of args @param [ out ] exception pointer to a JSValueRef in which to return an exception if any