Sun Jun 27 2021
Automatic CDN switching
Many customers choose to follow a multi-CDN strategy. Switching to the optimal CDN (content delivery network) in real time can be done a number of ways; here is just one approach leveraging two of the bitmovin products:
- the bitmovin ANALYTICS module for real-time QoS, and
- the bitmovin PLAYER logic to adjust the source.
Note: this guide assumes you serve your webpage/app via a webCMS, a fairly normal practice.
STEP ONE: setting a threshold trigger in analytics
In this example the median video startup time is acting as the trigger for CDN change. If the analytics tool identifies a prolonged threshold breach then a webhook is fired.
STEP TWO: modifying source URL
Functionality inside your webCMS should allow for a variable change upon receiving a webhook. In this case the variable would normally contain the URL-prefix associated with CDN-A (primary content deliver network); changing to CDN-B (backup content delivery network) upon receiving webhook.
STEP THREE: playing based on a variable
The bitmovin player requires a sourceURL pointing at where to find the video manifest, normally injected by the webCMS. In this example the sourceURL would be formed by concatenating the CDN variable with the URL's ending allowing the platform to swing CDN as network conditions dictate.
1CDN-A = https://myCDN.x/2CDN-B = https://otherCDN.x/3URL ending = 1234/manifest.m3u8?..4source = https://myCDN.x/1234/manifest.m3u8?.. <> https://otherCDN.x/1234/manifest.m3u8?..
Note: this example is a little over simplified; logic will be needed to swing back to CDN-A; and potentially trigger on more than just the video startup time metric, but it shows how analytics thresholds might be used for both for alerting and proactive maintenance.