gort818 / qtwebflix

A qt webengine program for netflix
GNU General Public License v3.0
248 stars 28 forks source link

Implement mpris support for Netflix (fixes #45) #50

Closed petrmanek closed 5 years ago

petrmanek commented 5 years ago

Here's a TL;DR:

More information can be found in the discussion related to the referenced issue.

petrmanek commented 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.

gort818 commented 5 years ago

@petrmanek Awesome! Thanks again. I am writing the amazon interface as we speak. will merge shortly

gort818 commented 5 years ago

@petrmanek How would you like to credited in the authors file?

petrmanek commented 5 years ago

@gort818 Sure, thank you! :+1: