Adds full support for YouTube playback.

While a few optimizations could be made, YouTube playback is almost as seamless as local playback.
This commit is contained in:
Markil3
2021-08-17 01:23:23 -06:00
parent ede9132279
commit 9c2cea1662
23 changed files with 388 additions and 261 deletions

View File

@@ -219,7 +219,15 @@ public class BrowserLink extends MessageRunner
if (clazz != null)
{
return gson.fromJson(message, clazz);
try
{
return gson.fromJson(message, clazz);
}
catch (Exception e)
{
logger.error("Could not parse " + message, e);
throw e;
}
}
else
{

View File

@@ -52,6 +52,10 @@ public class Main
* Pretty much just forwards any messages to the browser and
* returns their value.
*/
browserLink.addUpdateListener((update, link) -> {
logger.debug("Sending update {}", update);
interfaceLink.sendUpdate(update);
});
interfaceLink.addListener((providedValue, previousReturn) -> {
logger.debug("Forwarding message to browser: {}", providedValue);
Object returnValue = browserLink.sendObject(providedValue).get();