I would like to ask about the plan selection
1 Click on the video to pause the recording time, and then record the time.
2 Use websocket to record the viewing time every 10 seconds
Ask if it is necessary to use websocket. The first option is to prevent the customer from suddenly closing the browser and there will be no record. The second option is to occupy resources
怪我咯2017-06-23 09:14:05
1. Record once when closing the browser (there is a trigger time when closing the browser)
2. Record once every 10 seconds
There will be no problem of occupying resources, just set a timer and record a cookie
三叔2017-06-23 09:14:05
You can come up with plan 3, record the time every 1-2 minutes, and then combine it with plan 1, which can basically meet the requirements
phpcn_u15822017-06-23 09:14:05
If you want to have both, combine the first and second solutions. But there is no need to update the viewing time every 10 seconds. You can set it to record 1/10 of the total video time. I personally don't think you need to choose the second option, just the first one.