mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Add index.d.ts * Add Definition comments * Add tsconfig * Add tslint * Add some tests * whitespace * Remove default value types * Use default type parameter * Add public methods * Use ! * Export default
33 lines
722 B
TypeScript
33 lines
722 B
TypeScript
import ReactAudioPlayer from 'react-audio-player';
|
|
import * as React from 'react';
|
|
import { render } from 'react-dom';
|
|
|
|
declare const appContainer: HTMLElement;
|
|
|
|
render(<ReactAudioPlayer />, appContainer);
|
|
|
|
render(<ReactAudioPlayer src="/files/George_Gershwin_playing_Rhapsody_in_Blue.ogg" controls />, appContainer);
|
|
|
|
let rap: ReactAudioPlayer | null = null;
|
|
render(
|
|
<ReactAudioPlayer
|
|
ref={r => {
|
|
rap = r;
|
|
}}
|
|
id="player"
|
|
loop
|
|
muted
|
|
onError={() => {}}
|
|
title="Fur Elise"
|
|
volume={10}
|
|
/>,
|
|
appContainer,
|
|
);
|
|
|
|
if (rap !== null) {
|
|
rap!.clearListenTrack();
|
|
rap!.setListenTrack();
|
|
rap!.updateVolume(5);
|
|
rap!.audioEl.pause();
|
|
}
|