jsbindings/jsbindings.cpp
/**
 * @brief Callback invoked from JS to set video mute status
 *
 * @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 AAMP_setVideoMute(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef *exception)
{
	LOG("[AAMP_JS] %s()", __FUNCTION__); 
	AAMP_JS* pAAMP = (AAMP_JS*)JSObjectGetPrivate(thisObject);
	if(!pAAMP)
	{
		ERROR("[AAMP_JS] %s() Error: JSObjectGetPrivate returned NULL!", __FUNCTION__);
		*exception = aamp_GetException(context, AAMPJS_MISSING_OBJECT, "Can only call AAMP.setVideoMute on instances of AAMP");
		return JSValueMakeUndefined(context);
	}
	if (argumentCount != 1)
	{
		ERROR("[AAMP_JS] %s() InvalidArgument: argumentCount=%d, expected: 1", __FUNCTION__, argumentCount);
		*exception = aamp_GetException(context, AAMPJS_INVALID_ARGUMENT, "Failed to execute 'AAMP.setVideoMute' - 1 argument required");
	}
	else
	{
		bool muted = JSValueToBoolean(context, arguments[0]);
		pAAMP->_aamp->SetVideoMute(muted);
	}
	return JSValueMakeUndefined(context);
}
static JSValueRef AAMP_setVideoMute ( JSContextRef context , JSObjectRef function , JSObjectRef thisObject , size_t argumentCount , const JSValueRef arguments [ ] , JSValueRef * exception ) { LOG ( " " , __FUNCTION__ ) ; AAMP_JS * pAAMP = ( AAMP_JS * ) JSObjectGetPrivate ( thisObject ) ; if ( ! pAAMP ) { ERROR ( " " , __FUNCTION__ ) ; * exception = aamp_GetException ( context , AAMPJS_MISSING_OBJECT , " " ) ; return JSValueMakeUndefined ( context ) ; } if ( argumentCount != 1 ) { ERROR ( " " , __FUNCTION__ , argumentCount ) ; * exception = aamp_GetException ( context , AAMPJS_INVALID_ARGUMENT , " " ) ; } else { bool muted = JSValueToBoolean ( context , arguments [ 0 ] ) ; pAAMP -> _aamp -> SetVideoMute ( muted ) ; } return JSValueMakeUndefined ( context ) ; }
@brief Callback invoked from JS to set video mute status
 @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 invoked from JS to set video mute status @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