v1.2.0-beta/fix file structure
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import firebase from 'firebase/app';
|
||||
import App from './App';
|
||||
import './index.css';
|
||||
import { PLAYER_SOURCE, getPlayerSource } from './Api';
|
||||
|
||||
const firebaseConfig = {
|
||||
apiKey: 'AIzaSyCJLuYpzXLDRmu2ttzFuSGmYcpFxqToWFU',
|
||||
authDomain: 'watch-party-crx.firebaseapp.com',
|
||||
databaseURL: 'https://watch-party-crx.firebaseio.com',
|
||||
projectId: 'watch-party-crx',
|
||||
storageBucket: 'watch-party-crx.appspot.com',
|
||||
messagingSenderId: '712242707190',
|
||||
appId: '1:712242707190:web:65fa7f772e30da364b0ad7',
|
||||
measurementId: 'G-EZS4PEVG4T',
|
||||
};
|
||||
|
||||
firebase.initializeApp(firebaseConfig);
|
||||
|
||||
const PartyWrapper = document.createElement('div');
|
||||
PartyWrapper.id = 'party_wrapper';
|
||||
document.body.appendChild(PartyWrapper);
|
||||
|
||||
switch (getPlayerSource()) {
|
||||
case PLAYER_SOURCE.NETFLIX:
|
||||
document.body.classList.add('netflix');
|
||||
break;
|
||||
case PLAYER_SOURCE.HULU:
|
||||
document.addEventListener(
|
||||
'keydown',
|
||||
(ev) => {
|
||||
if (ev.target.tagName !== 'INPUT' || ev.target.tagName !== 'TEXTAREA') {
|
||||
ev.stopImmediatePropagation();
|
||||
ev.stopPropagation();
|
||||
} else {
|
||||
ev.target.focus();
|
||||
}
|
||||
},
|
||||
{ capture: true }
|
||||
);
|
||||
document.body.classList.add('hulu');
|
||||
const ds = document.createElement('script');
|
||||
ds.text = `window.doquery=function(){window.huluPlayer=window.queryObjects(window.HuluMediaPlayer);}`;
|
||||
document.head.appendChild(ds);
|
||||
break;
|
||||
case PLAYER_SOURCE.AMAZON:
|
||||
document.body.classList.add('amazon-prime');
|
||||
break;
|
||||
case PLAYER_SOURCE.DISNEY:
|
||||
document.body.classList.add('disney');
|
||||
break;
|
||||
case PLAYER_SOURCE.YOUTUBE:
|
||||
document.body.classList.add('youtube');
|
||||
break;
|
||||
case PLAYER_SOURCE.HBONOW:
|
||||
document.body.classList.add('hbo');
|
||||
break;
|
||||
case PLAYER_SOURCE.LOCAL:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
ReactDOM.render(
|
||||
<React.StrictMode>
|
||||
<App />
|
||||
</React.StrictMode>,
|
||||
PartyWrapper
|
||||
);
|
||||
Reference in New Issue
Block a user