Adapters are a way to unify event shapes and it makes integration with new players much easier.
import { Vidmon, HTMLAdapter } from 'vidmon';
const vidmon = new Vidmon(new HTMLAdapter(videoElement), options);
- HTMLAdapter: HTML5 Video Player, // Web native HTML5
- TizenAVAdapter: Tizen AV Player, // Tizen
- AppleAVAdapter: Apple AV Play, // iOS
- AndroidExoAdapter: Android Exo Player, // Android
-
Extend
Adapter
class You can find it insrc/Adapters/Adapter.js
-
Implement both methods in your adapter class
attachListeners = (callback) => {}; detachListeners = () => {};
-
attachListeners
should subscribe to all available events fired from the player -
detachListeners
should unsubscribe to all events