get cast device from chromecast transport

This commit is contained in:
nklhrstv 2020-05-18 14:05:15 +03:00
parent 1edf6484d8
commit d770b5572a

View file

@ -228,8 +228,13 @@ function ChromecastTransport() {
this.getSessionState = function() {
return cast.framework.CastContext.getInstance().getSessionState();
};
this.getCurrentSession = function() {
return cast.framework.CastContext.getInstance().getCurrentSession();
this.getCastDevice = function() {
const session = cast.framework.CastContext.getInstance().getCurrentSession();
if (session !== null) {
return session.getCastDevice();
}
return null;
};
}