Skip to content

Commit

Permalink
web: Define global function P5 on HydraCanvas (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
munshkr committed Mar 24, 2020
1 parent f95fb3a commit 077f0f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/web/components/HydraCanvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ class HydraCanvas extends Component<Props, State> {
// eslint-disable-next-line global-require
const Hydra = require("hydra-synth");

// eslint-disable-next-line global-require
const P5 = require("p5");

window.P5 = P5

// For some reason on Android mobile, Chrome has this object undefined:
if (!window.navigator.mediaDevices) return;

Expand Down
1 change: 1 addition & 0 deletions packages/web/lib/windowExtensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ declare global {
interface Window {
src: Function;
H: Function;
P5: Function;
}
}

0 comments on commit 077f0f9

Please sign in to comment.