Real-Time Video Player Activity Tracker

Job ID: 38791183

Budget: £750 – £1,500 GBP

I'm looking to implement a heartbeat feature in my video player using Web Sockets via Laravel Reverb. The main goal of this feature is to monitor user activity in real-time, specifically how much time they are spending watching the video.

Key Requirements:
- Real-time monitoring of user activity, specifically 'time spent watching'
- Using Web Sockets with Laravel Reverb for seamless live tracking
- Storing the collected user activity data in a database for future analysis

Ideal Skills:
- Proficient in Laravel and Web Sockets
- Experience with real-time data tracking implementations
- Skilled in database management and data storage solutions

Please note, this project does not require monitoring of 'Play/Pause' events or 'Buffering' occurrences. The focus is solely on tracking viewer engagement in terms of time.

Detailed Requirements:
The project will use Laravel Reverb (https://laravel.com/docs/11.x/reverb) to:

- When video playback starts, open a new web socket and create a Session with metadata such as the User ID, Content Type, Content ID etc.
- Whilst the video is playing, use the socket to update the Session with the playback position.
- The playback position is the position on the seek bar whether the player is playing or paused.
- When video playback stops, send the final playback position, update the playback position and close the socket.
- Immediately on close, send the Completed Session to an RDS database including the Session ID, Start Time, End Time, Content Type, Content ID and Playback Position, together with any other information that can be collected, such as IP Address, User Agent etc.

Considerations:
- The project should use Google Shaka Player as the player, with the web socket code written in native Javascript.
- How many simultaneous sockets can be open on one server? Can we run multiple servers behind an AWS ELB with "stickness" enabled? Or is this not required for Web Sockets?

We are open to improvements to this approach.
Related categories: PHP MySQL Laravel Video Streaming