Skip to content

Commit

Permalink
Merge pull request #86 from hawken93/hawken-fixes
Browse files Browse the repository at this point in the history
make compatible with chromium 83
  • Loading branch information
YouKnowBlom authored Dec 6, 2020
2 parents a97e97a + 36bd17b commit 0c071d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/jellyfinActions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ajax } from './fetchhelper';
import { ajax } from './fetchhelper';

import {
getUrl,
Expand Down
9 changes: 8 additions & 1 deletion src/components/maincontroller.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable */
/* eslint-disable */

import {
reportPlaybackProgress,
Expand Down Expand Up @@ -488,6 +488,13 @@ window.castReceiverContext.addCustomMessageListener(

var data = evt.data;

// Apparently chromium likes to pass it as json, not as object.
// chrome on android works fine
if (typeof data == 'string' || data instanceof String) {
console.log('Event data is a string.. Chromium detected..');
data = JSON.parse(data);
}

data.options = data.options || {};
data.options.senderId = evt.senderId;
// TODO set it somewhere better perhaps
Expand Down

0 comments on commit 0c071d3

Please sign in to comment.