one
Version:
One is a React framework for web, iOS, and Android apps.
89 lines (86 loc) • 4.16 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all) __defProp(target, name, {
get: all[name],
enumerable: true
});
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var index_native_exports = {};
__export(index_native_exports, { Audio: () => Audio });
module.exports = __toCommonJS(index_native_exports);
var import_validateCallback = require("../validateCallback.native.js");
var import_nativeError = require("../nativeError.native.js");
var import_hybrid = require("./hybrid.native.js");
var import_player = require("./player.native.js");
var Audio = Object.freeze({
getRecordingPermissionStatus: function getRecordingPermissionStatus() {
return (0, import_hybrid.audioNative)().getRecordingPermissionStatus().catch(import_nativeError.rethrowNativeError);
},
requestRecordingPermission: function requestRecordingPermission() {
return (0, import_hybrid.audioNative)().requestRecordingPermission().catch(import_nativeError.rethrowNativeError);
},
play: function play(uri) {
return (0, import_hybrid.audioNative)().play(uri).catch(import_nativeError.rethrowNativeError);
},
getPlaybackStatus: function getPlaybackStatus() {
return (0, import_hybrid.audioNative)().getPlaybackStatus().catch(import_nativeError.rethrowNativeError);
},
pause: function pause() {
return (0, import_hybrid.audioNative)().pause().catch(import_nativeError.rethrowNativeError);
},
resume: function resume() {
return (0, import_hybrid.audioNative)().resume().catch(import_nativeError.rethrowNativeError);
},
seek: function seek(positionMs) {
return (0, import_hybrid.audioNative)().seek(positionMs).catch(import_nativeError.rethrowNativeError);
},
stop: function stop() {
return (0, import_hybrid.audioNative)().stop().catch(import_nativeError.rethrowNativeError);
},
startRecording: function startRecording() {
return (0, import_hybrid.audioNative)().startRecording().catch(import_nativeError.rethrowNativeError);
},
getRecordingStatus: function getRecordingStatus() {
return (0, import_hybrid.audioNative)().getRecordingStatus().catch(import_nativeError.rethrowNativeError);
},
pauseRecording: function pauseRecording() {
return (0, import_hybrid.audioNative)().pauseRecording().catch(import_nativeError.rethrowNativeError);
},
resumeRecording: function resumeRecording() {
return (0, import_hybrid.audioNative)().resumeRecording().catch(import_nativeError.rethrowNativeError);
},
stopRecording: function stopRecording() {
return (0, import_hybrid.audioNative)().stopRecording().catch(import_nativeError.rethrowNativeError);
},
watchInterruptions: function watchInterruptions(onEvent) {
(0, import_validateCallback.validateCallback)(onEvent, "Audio.watchInterruptions: onEvent must be a function");
return (0, import_hybrid.audioNative)().addInterruptionListener(onEvent);
},
setNowPlayingInfo: function setNowPlayingInfo(info) {
return (0, import_hybrid.audioNative)().setNowPlayingInfo(info).catch(import_nativeError.rethrowNativeError);
},
clearNowPlayingInfo: function clearNowPlayingInfo() {
return (0, import_hybrid.audioNative)().clearNowPlayingInfo().catch(import_nativeError.rethrowNativeError);
},
watchRemoteCommands: function watchRemoteCommands(onEvent) {
(0, import_validateCallback.validateCallback)(onEvent, "Audio.watchRemoteCommands: onEvent must be a function");
return (0, import_hybrid.audioNative)().addRemoteCommandListener(onEvent);
},
AudioPlayer: import_player.AudioPlayer,
createPlayer: import_player.createPlayer
});
//# sourceMappingURL=index.native.js.map