Closed petrmanek closed 5 years ago
OK, check it out.
The latest implementation can switch between various MPRIS interfaces based on the hostname. Currently, only two interfaces are available -- one for Netflix and the other as a fallback for other service providers.
When the page loading is finished, hostname is matched against very simple string criteria and a MprisInterface
subclass is proposed. If that class differs from the current interface (this is detected courtesy of std::type_index), it becomes the current interface and gets set up. However, this doesn't occur before the destructor of the previous interface is called -- this way, at most one instance of MprisPlayer
exists in the scope at all times and no clashes occur.
@petrmanek Awesome! Thanks again. I am writing the amazon interface as we speak. will merge shortly
@petrmanek How would you like to credited in the authors file?
@gort818 Sure, thank you! :+1:
Here's a TL;DR:
More information can be found in the discussion related to the referenced issue.