new IQ()
IQ class.
It provides the API to report events for Ooyala IQ backend
Methods
-
handleEvent(message)
-
HandleEvent should be called every time an event arises on the roVideoScreen/ roVideoPlayer message port (usually as a part of the main event loop). The IQ SDK will then process and report the appropriate events to the IQ backend.
Parameters:
Name Type Description messageRoku event obtained in the main loop with msg = wait(1000, messagePort)
-
init(pcode)
-
Init the IQ library, starts the session
Parameters:
Name Type Description pcodeThe API key found in Ooyala Backlot, which identifies your account to Ooyala
-
reportCustomEvent(name, metadata)
-
Report a custom event.
Parameters:
Name Type Description nameString Event name
metadataEvent metadata
Example
m.iq.reportCustomEvent("myEvent", {val1 : 42, myString : "my custom string"}) -
reportEventLoopExit()
-
This method should be called when the content event loop is exited (content end, user action, and so on).
-
reportPlayRequested(isAutoPlay)
-
This method should be called when the user has requested the video to start playing.
Parameters:
Name Type Description isAutoPlayBoolean Boolean indicating whether the video was automatically played or started by the user
-
reportReplay()
-
This method should be called when a user replays a video.
-
setContentMetadata(metadata)
-
Sets the metadata from a video about to be played.
Parameters:
Name Type Description metadataIQ.ContentMetadata metadata object
-
setGeoInfo(geoInfo)
-
Sets the geo info to be reported to the IQ backend (optional)
Parameters:
Name Type Description geoInfoIQ.GeoInfo geo info
-
setUserInfo(userInfo)
-
Sets the user info to be reported to the IQ backend (optional)
Parameters:
Name Type Description userInfoIQ.UserInfo user info
Type Definitions
-
AgeGroup
-
Type:
- Object
Properties:
Name Type Description minnumber user age group minimum age
maxnumber user age group maximum age
-
ContentMetadata
-
Type:
- Object
Properties:
Name Type Description durationnumber Duration of the content in seconds
assetIdString Video's embed code
assetTypeString asset type : "ooyala" or "external"
-
GeoInfo
-
Type:
- Object
Properties:
Name Type Description countryCodeString ISO 2-alpha code of the country of the user
regionString Region of the user
stateString State of the user
cityString City of the user
latitudeNumber Latitude of the user
longitudeNumber Longitude of the user
geoVendorString Name of the vendor which provided these details. If available.
-
UserInfo
-
Type:
- Object
Properties:
Name Type Description emailHashMD5String MD5 hash of the user email
userIdString User Id
genderString User gender ("M" or "F")
ageGroupIQ.AgeGroup user age group
IQ Roku library API Documentation