UNPKG

one

Version:

One is a React framework for web, iOS, and Android apps.

66 lines (63 loc) • 2.54 kB
import { validateCallback } from "../validateCallback.native.js"; import { rethrowNativeError } from "../nativeError.native.js"; import { audioNative } from "./hybrid.native.js"; import { AudioPlayer, createPlayer } from "./player.native.js"; var Audio = Object.freeze({ getRecordingPermissionStatus: function getRecordingPermissionStatus() { return audioNative().getRecordingPermissionStatus().catch(rethrowNativeError); }, requestRecordingPermission: function requestRecordingPermission() { return audioNative().requestRecordingPermission().catch(rethrowNativeError); }, play: function play(uri) { return audioNative().play(uri).catch(rethrowNativeError); }, getPlaybackStatus: function getPlaybackStatus() { return audioNative().getPlaybackStatus().catch(rethrowNativeError); }, pause: function pause() { return audioNative().pause().catch(rethrowNativeError); }, resume: function resume() { return audioNative().resume().catch(rethrowNativeError); }, seek: function seek(positionMs) { return audioNative().seek(positionMs).catch(rethrowNativeError); }, stop: function stop() { return audioNative().stop().catch(rethrowNativeError); }, startRecording: function startRecording() { return audioNative().startRecording().catch(rethrowNativeError); }, getRecordingStatus: function getRecordingStatus() { return audioNative().getRecordingStatus().catch(rethrowNativeError); }, pauseRecording: function pauseRecording() { return audioNative().pauseRecording().catch(rethrowNativeError); }, resumeRecording: function resumeRecording() { return audioNative().resumeRecording().catch(rethrowNativeError); }, stopRecording: function stopRecording() { return audioNative().stopRecording().catch(rethrowNativeError); }, watchInterruptions: function watchInterruptions(onEvent) { validateCallback(onEvent, "Audio.watchInterruptions: onEvent must be a function"); return audioNative().addInterruptionListener(onEvent); }, setNowPlayingInfo: function setNowPlayingInfo(info) { return audioNative().setNowPlayingInfo(info).catch(rethrowNativeError); }, clearNowPlayingInfo: function clearNowPlayingInfo() { return audioNative().clearNowPlayingInfo().catch(rethrowNativeError); }, watchRemoteCommands: function watchRemoteCommands(onEvent) { validateCallback(onEvent, "Audio.watchRemoteCommands: onEvent must be a function"); return audioNative().addRemoteCommandListener(onEvent); }, AudioPlayer, createPlayer }); export { Audio }; //# sourceMappingURL=index.native.js.map