Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import './App.css';
  3.  
  4. const IS_WEB_AUDIO_SUPPORTED = window.AudioContext || window.webkitAudioContext ? true : false;
  5. const audioCtx = IS_WEB_AUDIO_SUPPORTED ? window.AudioContext || window.webkitAudioContext : null;
  6.  
  7. class App extends Component {
  8. render() {
  9. return (
  10. <div className="App">
  11. <header className="App-header">
  12. Is Web Audio Supported?
  13. <div>{IS_WEB_AUDIO_SUPPORTED ? "😊" : "😰"}</div>
  14. Is AudioContext available?
  15. <div>{audioCtx ? "😊" : "😰"}</div>
  16. </header>
  17. </div>
  18. );
  19. }
  20. }
  21.  
  22. export default App;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement