The migration from VHL 1.x to VHL 2.x is straightforward, with the new version featuring simplified APIs for initialization, configuration, and player delegates.
Here are the primary differences between 1.x and 2.x:
All of the public methods are consolidated into the
MediaHeartbeat class to make implementation easier on developers.
All configs are now consolidated into the
You no longer need to instantiate configs for the Analytics, VideoPlayer, and Heartbeat plugins. You only need to instantiate the
MediaHeartbeat class with
MediaHeartbeatConfig instances. This is the only implementation that is required to initialize Media Analytics.
With the initialization of
MediaHeartbeat, you can safely delete all of the implementation for Analytics Plugin, VideoPlayer Plugin, and Heartbeat Plugin. Also, remove all the existing implementation for initialization that takes in an array of plugins as an input. You can see side-by-side comparisons of the 1.x and 2.x implementations here: Code comparison: 1.x to 2.x.
The new APIs in 2.x are described in detail here: API 1.x to 2.x conversion.