Introduction
Currently, to play the contents we need to pass all the config data to the player. In this config there are some mandatory and options fields. This wiki explains those mandatory and optional fields.
- KN-63Getting issue details... STATUS
PDF player configuration
The following configuration is required to play the pdf content in player
context
config
metadata
pdfPlayerConfig = { context: {_contextData_}, config: {_configData_}, metadata: {_metadataObject_} }
1. Context contains the following properties:
Property name | Description | optional/Required | With property | Without property | Comment | |
---|---|---|---|---|---|---|
1 | mode | To identify preview used by the user to play/edit/preview | Optional | No change in telemetry data | No change in telemetry data | Can be set it as preview from the player side. There is no major impact in player preview. |
2 | authToken | Auth key to make the api call | Optional | No change in telemetry data | No change in telemetry data | As we are not calling any api from player side authtoken property can be optional. |
3 | sid | User sessionId | Required | sid will log in telemetry | sid will not log in telemetry | Default can be set from player side |
4 | did | Unique id to identify the device | Required | did will log in telemetry | did will not log in telemetry | Default can be set from player side |
5 | uid | Current logged in user id | Required | uid will log in telemetry | uid will not log in telemetry | Default can be set from player side |
6 | channel | Unique id of the channel | Required | channel id will log in telemetry | channel id will not log in telemetry | This can be a optional and can be set it from player side a a default parameter. |
7 | pdata | producer id | Required | { | {} | Default can be set from player side |
8 | contextRollup | Defines the content rollup data | Optional | Context rollup will log in telemetry context | content rollup will not log in context | Its a optional field in telemetry |
9 | objectRollup | Defines the content object data | Optional | Object rollup will log in telemetry | Object rollup will not log in telemetry | Its a optional field in telemetry |
10 | tags | defines the tags data | Optional | Tag will log | Empty tag list will log | Its a optional tags data |
11 | cdata | Defines the correlation data | Required | Must required in telemtry | Telemetry validation will fail | Correlation data requires for telemetry |
12 | timeDiff | It defines the time difference | Optional | No change in telemetry data | No change in telemetry data | This can be a optional field |
13 | host | Defines the from which domain content should be loaded | Optional | No change in telemetry data | No change in telemetry data | Default can be set from player side |
14 | endpoint | It defines the endpoint | Optional | No change in telemetry data | No change in telemetry data | This can be a optional |
15 | userData | Defines the user first name and last name | Optional | End page will show the first name and last name from userData | User first and lastname will not show in endpage | Default can be set from player side |
pdata: If we not pass the pdata the pdata will not logged in telemetry
Sample telemetry data without pdata
{"eid":"INTERACT","ets":1662988243357,"ver":"3.0","mid":"INTERACT:fcd57afb91574c6526058b5aa68403de","actor":{"id":"3c0a3724311fe944dec5df559cc4e006","type":"User"},"context":{"channel":"505c7c48ac6dc1edc9b08f21db5a571d","env":"contentplayer","sid":"7283cf2e-d215-9944-b0c5-269489c6fa56","did":"3c0a3724311fe944dec5df559cc4e006","cdata":[{"id":"XBfyG8Hd4lF7SKSM9Rvj5CdoXKfntwEd","type":"ContentSession"},{"id":"bFLHgkI1NTnhl1IOzS2nch0bH3EkpFkE","type":"PlaySession"},{"id":"2.0","type":"PlayerVersion"}],"rollup":{"l1":"505c7c48ac6dc1edc9b08f21db5a571d"},"uid":"anonymous"},"object":{"id":"do_31291455031832576019477","ver":"undefined","type":"Content","rollup":{}},"tags":[""],"edata":{"type":"TOUCH","subtype":"","id":"next","pageid":"2"}}
contextRollup: If we not pass the pdata the pdata will not logged in telemetry
Sample content object telemetry data without rollup
"context": { .... .... "rollup": {}, "uid": "anonymous" }
sid, did, uid, channel: If we not pass the pdata the pdata will not logged in telemetry
Sample telemetry data without pdata:
{"eid":"INTERACT","ets":1662989700604,"ver":"3.0","mid":"INTERACT:df20f452603133275899885c89826a0a","actor":{"id":"ac7fa5a7da1312d0603d351c941a2813","type":"User"},"context":{"pdata":{"id":"sunbird.portal","ver":"3.2.12","pid":"sunbird-portal.contentplayer"},"env":"contentplayer","did":"ac7fa5a7da1312d0603d351c941a2813","cdata":[{"id":"QtPz7hI6rQjEqosRF3Shlwx9jhMOSzGs","type":"ContentSession"},{"id":"ikwUrq2L04DcojCek0Remi2nvmlbkJwr","type":"PlaySession"},{"id":"2.0","type":"PlayerVersion"}],"rollup":{"l1":"505c7c48ac6dc1edc9b08f21db5a571d"}},"object":{"id":"do_31291455031832576019477","ver":"undefined","type":"Content","rollup":{}},"tags":[""],"edata":{"type":"TOUCH","subtype":"","id":"next","pageid":"2"}}
tags: If we not pass the tags the empty tags will log in telemetry
Sample telemetry data without tags:
"context": { ... "tags": [],
objectRollup: If we not pass the pdata the pdata will not logged in telemetry
Sample content object telemetry data without rollup
"context: { }, "object": { "id": "do_31291455031832576019477", "ver": "undefined", "type": "Content", "rollup": {} },
userData: If we pass the userData, it will show in endpage.
If we not send - it will not show.
dispatcher: Dispatcher is required to receive the player events. This is optional and if we not passed, the parent will not received the player events.
dispatcher: { dispatch(event) { console.log(`Events from dispatcher: ${JSON.stringify(event)}`); } }
Sample context object:
{ "mode": "play", // To identify preview used by the user to play/edit/preview "authToken": "", // Auth key to make api calls "sid": "7283cf2e-d215-9944-b0c5-269489c6fa56", // User sessionid on portal or mobile "did": "3c0a3724311fe944dec5df559cc4e006", // Unique id to identify the device or browser "uid": "anonymous", // Current logged in user id "channel": "505c7c48ac6dc1edc9b08f21db5a571d", // Unique id of the channel(Channel ID) "pdata": { "id": "sunbird.portal", // Producer ID. For ex: For sunbird it would be "portal" or "genie" "ver": "3.2.12", // Version of the App "pid": "sunbird-portal.contentplayer" // Optional. In case the component is distributed, then which instance of that component }, "contextRollup": { // Defines the content roll up data "l1": "505c7c48ac6dc1edc9b08f21db5a571d" }, "tags": [ // Defines the tags data "" ], "cdata": [], // Defines correlation data "timeDiff": 0, // Defines the time difference "objectRollup": {}, // Defines the object roll up data "host": "", // Defines the from which domain content should be load "endpoint": "", // Defines the end point "userData": { // Defines the user data firstname & lastname "firstName": "", "lastName": "" } }
2. Config
All the configuration can be set by default from player side so this config object can be optional
ideMenu
: If we not pass the side menu object for pdf config - the default the following menu will show in sidemenu
Share
Download
Print
sample config data
"config": { "sideMenu": { "showShare": true, // show/hide share button in side menu. default value is true "showDownload": true, // show/hide download button in side menu. default value is true "showReplay": true, // show/hide replay button in side menu. default value is true "showExit": false, // show/hide exit button in side menu. default value is false "showPrint": true // show/hide print button in side menu. default value is true } }
3. Metadata
In metadata the following properties are mandatory.
Property name | Description | optional/Required | Comment |
---|---|---|---|
identifier | It is | Required | Its a unique content id so Its a required to log the telemetry and other data against contnet |
Name | It is | Required | Its a required to show the name of the pdf while loading the pdf. |
streamingUrl | It is | Required | It is required to load the pdf file from streaming url |
artifactUrl/streamingUrl : If we not pass the artifactUrl or streamingUrl, The pdf content will not load and it will show error. To load the content artifactUrl or streamingUrl is required.