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:
@@ -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
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user