Service: Player Analytics Eventsink - EyevinnOSC/community GitHub Wiki
Getting Started
The Eyevinn Player Analytics Specification (EPAS) is an open source and open standard for video player analytics. The Player Analytics Eventsink receives events from the video player according to EPAS. This eventsink is available as an open web service in Eyevinn Open Source Cloud and this guide will walk you through how to get started.
Prerequisites
- An Eyevinn Open Source Cloud account. Sign up here for free.
Step 1: Create an SQS queue
The eventsink pushes events it receives on to an SQS queue ready for the workers to pick up. We will use the open web service SmoothMQ in Eyevinn Open Source Cloud that provides an SQS compatible queue. Navigate to the SmoothMQ service in the web console. Press the button "Create message queue".
We give the instance the name guide
and access key guide
and secret secret
. We recommend to use stronger credentials stored as service secrets that are referenced instead.
When the SmoothMQ instance is up and running we can create a queue that we want to use. We will be using the AWS command line tool for that. The --endpoint-url
is the URL to the SmoothMQ instance. Replace this with the URL to your instance.
% AWS_ACCESS_KEY_ID=guide AWS_SECRET_ACCESS_KEY=secret AWS_REGION=osc \
aws sqs create-queue --queue-name=events --endpoint-url=https://eyevinnlab-guide.poundifdef-smoothmq.auto.prod.osaas.io
{
"QueueUrl": "https://sqs.us-east-1.amazonaws.com/1/events"
}
In return you get the QueueUrl and in this case it is https://sqs.us-east-1.amazonaws.com/1/events
. Take a note on this as you will use it later.
Step 2: Create an EPAS eventsink
Now navigate to the Player Analytics Eventsink in Eyevinn Open Source Cloud web console. Press the button "Create eventsink".
- Name:
guide
- SqsQueueUrl:
https://sqs.us-east-1.amazonaws.com/1/events
- AwsAccessKeyId:
guide
- AwsSecretAccessKey:
secret
- SqsEndpoint:
https://eyevinnlab-guide.poundifdef-smoothmq.auto.prod.osaas.io
- replace this with the URL to your SmoothMQ instance.
Step 3: Send a test event
We can now test sending an init event for a session to the eventsink using curl.
% curl -X POST --json '{ "event": "init", "sessionId": "3", "timestamp": 1740411580982, "playhead": -1, "duration": -1 }' https://eyevinnlab-guide.eyevinn-player-analytics-eventsink.auto.prod.osaas.io
{"sessionId":"3","heartbeatInterval":5000}
where https://eyevinnlab-guide.eyevinn-player-analytics-eventsink.auto.prod.osaas.io
is the URL to your eventsink.
We can now use the AWS command line tool to check that the message was placed in the queue.
% AWS_ACCESS_KEY_ID=guide AWS_SECRET_ACCESS_KEY=secret AWS_REGION=osc \
aws sqs receive-message
--queue-url=https://sqs.us-east-1.amazonaws.com/1/events \
--endpoint-url https://eyevinnlab-guide.poundifdef-smoothmq.auto.prod.osaas.io
{
"Messages": [
{
"MessageId": "1894067124679217152",
"ReceiptHandle": "1894067124679217152",
"MD5OfBody": "56e41ee2399ef83003d1d230e8d11212",
"Body": "{\"event\":\"init\",\"sessionId\":\"3\",\"timestamp\":1740411580982,\"playhead\":-1,\"duration\":-1}",
"MessageAttributes": {
"Event": {
"StringValue": "init",
"DataType": "String"
},
"Time": {
"StringValue": "1740411580982",
"DataType": "String"
}
}
}
]
}