====== Requirement ====== To be able to measure the amount of video being streamed by each site/user through the self hosted streaming. Ideally it is measured as minutes or hours of video streamed. ===== Implementation ===== There are two ways we can track this and measure - a) Through Video player - This is the best way and recommended. b) Through streaming server. - Not preferred. Complex and tightly coupled architecture. ==== a) Through Video player (Recommended) ==== We can write a jwplayer plugin for desktops and videojs plugin for mobiles which will send the amount of video watched by user. The plugin can also send the number of page views, current devise/browser. We track more information as we need. (Note - We already track this for learnexa. The plugins can be tweaked a bit and be given to expertusone. As of now Eone uses jwplayer for web and videojs for mobile app as well.) On server, this data can be written either directly to DB after processing or first to a store like redis/memcached and then to the database. **Sample stats look like this -** 1. Hours of video viewed - http://www.jwplayer.com/blog/understanding-video-analytics/ 2. Break up by devise (Mobile, web, Tablet) can be provided as well. (Ex - https://www.jwplayer.com/wp-content/uploads/Screenshot-2014-12-09-13.02.50-300x190.png) === Advantages === 1. This keeps video tracking logic generic and app independent. Same plugin works for all apps and all streaming servers. No maintenance is needed if we move to another cloud server like FMS on Amazon cloud front. 2. Configurable - As our's is a multi tenant structure and only some companies have streaming enabled. So, this plugin can easily be added or not by the app's code based on the current tenant. 3. Very loosely coupled. 4. We can extend to track more info as needed. ==== b) Through steaming server (Not Recommended) ==== We need to write an app for the streaming server (red5) which tracks it based on the client/connection. This data needs to be exposed to app servers (Learnexa/Eone) so that they can access it and store in their database. Streaming server can also push the data. === Disadvantages === 1. Complex to build. Need to build the red5 app and also a way to store data locally and then push/expose it to the web apps. 2. Not maintainable. We need to write different apps if we need to move to another media server. 3. We use same red5 server for multiple tenants of Expertusone. So, some additional params need to be passed to differentiate the tenants. This invovles more code changes on both app and streaming server's side. ===== Plugins ===== [[Jwplayer Tracker Plugin | Jwplayer Tracker ]] [[Videojs Tracker Plugin | Videojs Tracker ]]