|
clearRecentVideos Method
Description
This method clears the list of recently viewed videos for a user.
Arguments
This method does not accept any arguments.
Syntax
The following code sample illustrates how this method can be invoked:
TVS = new TruveoVideoSearch(appid);
...
TVS.clearRecentVideos();
Return Value
This method returns 'true' if the AJAX request was sent successfully. This method will return 'false' if it is called while the user is not logged in.
Response Data Objects
The response returned by this method can update the following data objects:
|
method
|
A string containing the name of the API method used to retrieve the response. In this case, this field would return the string 'clearRecentVideos'.
Usage syntax: myVar = TVS.method;
|
|
Result
|
The container for the response code, response message and any other information returned in this response.
More details on the structure and attributes of this data object can be found here.
Usage syntax: myVar = TVS.Result;
|
Events
This method can fire the following events:
|
onupdate
|
This event fires when a response to an AJAX request
is received by the TruveoVideoSearch object. When this event fires, it will pass one argument, 'methodName', to any handler attached to this event. The value
of 'methodName' will be set to the name of the method that issued the original AJAX request associated with this onupdate event.
Event binding syntax: TVS.attachEvent('onupdate', 'myHandler(methodName);');
|
|
onerror
|
This event fires when an error occurs.
When this event fires, it will pass two arguments, 'errorCode' and 'errorMessage', to any handler attached to this event. The value
of 'errorCode' will be the numerical code assigned to the error and 'errorMessage' will be a text message that describes the error.
Event binding syntax: TVS.attachEvent('onerror', 'myHandler(errorCode, errorMessage);');
|
Errors
If execution of this method is not successful, the errors with the following error codes can be thrown:
|
1
|
Invalid request: 'appid'
An application ID was not submitted with the request.
|
|
2
|
Invalid request: 'method'
A method was not submitted with the request.
|
|
107
|
Invalid request: 'token'
The token parameter was not submitted with the request.
|
|
105
|
Invalid request: 'sig'
The sig parameter was not submitted with the request.
|
|
12
|
Service Unavailable
Truveo Video Search API service unavailable.
|
|
13
|
Method not found.
The method you submitted with the request was not valid.
|
|
14
|
Access Denied: invalid appid.
The application ID submitted with the request is invalid.
|
|
15
|
Access Denied: appid over limit.
The application ID submitted with the request is over the daily request limit.
|
|
103
|
Signature does not match
The signature that was supplied is invalid. The user could not be authenticated.
|
|
108
|
Invalid token
The token submitted with the request is either invalid or expired.
|
|
501
|
Error connecting to XMLHTTP AJAX service
The Truveo video search AJAX service could not be reached.
|
|
503
|
Method not available: You must be logged in to use this method.
The user is not logged in and is attempting to access a method of the AJAX API that requires login.
|
|