In my android app, I have a video player where I will be using third-party SDKs for that. I am aiming to work with three different video player SDKs. As you know, each of these SDKs has its own properties. I have managed to unify using different SDKs by having an abstract factory design pattern. So each of these SDKs have been implemented in a separate class and I do have a "video player factory" which unifies the interface for these SDKs.
For example, in my code, I have something like this:
videoPlayer1 = VideoPlayerFactory.getVideoPlayer(new VideoPlayerFromSDK1);
videoPlayer2 = VideoPlayerFactory.getVideoPlayer(new VideoPlayerFromSDK2);
videoPlayer1.unifiedFunction();
videoPlayer2.unifiedFunction();
With this abstract factory design patter, I can have as much video player SDK as I want. However, the problem is that including all those SDKs is not logical in the app. What I would like to do is to build the app only with one of those SDKs (based on customers need) and the app realizes which SDK is included and what instance of video player should be used.
For example, if in the build I only include SDK1, then only the instance of that SDK is created and used.
Is that possible?