cordova plugin add cordova-plugin-theta-plugin
I wrapped the theta-plugin-sdk(https://github.com/ricohapi/theta-plugin-sdk) with cordova.
- successCallback(keyCode)
keyCode: 27: Shutter Button, 130: Mode Button, 284: Wireless Button can be specified
- successCallback(keyCode)
keyCode: 27: Shutter Button, 130: Mode Button, 284: Wireless Button can be specified
- successCallback(keyCode)
keyCode: 27: Shutter Button, 130: Mode Button, 284: Wireless Button can be specified
- ledColor: "RED", "GREEN", "BLUE", "CYAN", "MAGENTA", "YELLOW", "WHITE"
window.plugins.theta.notificationLedShow(ledName: string, ledColor: string, period: number) : return Promise
- ledName: "LED3", "LED4", "LED5", "LED6", "LED7", "LED8"
- ledColor: "RED", "GREEN", "BLUE", "CYAN", "MAGENTA", "YELLOW", "WHITE"
- period: 250-2000 (msec)
- ledName: "LED3", "LED4", "LED5", "LED6", "LED7", "LED8"
- ledName: "LED3", "LED4", "LED5", "LED6", "LED7", "LED8"
- message: set error message
These APIs are still being tested.
So I will not recommend using it.
const app = {
initialize: function() {
console.log("initialize");
document.addEventListener('deviceready', this.onDeviceReady.bind(this), false);
},
onDeviceReady: function() {
this.receivedEvent('deviceready');
},
// Update DOM on a Received Event
receivedEvent: async (id) => {
console.log('Received Event: ' + id);
try{
// Call Theta Plugin API
await window.plugins.theta.notificationWlanOff().catch((e) => { console.error(e) });
await window.plugins.theta.notificationWlanAp().catch((e) => { console.error(e) });
await window.plugins.theta.notificationWlanCl().catch((e) => { console.error(e) });
await window.plugins.theta.notificationCameraClose().catch((e) => { console.error(e) });
await window.plugins.theta.notificationCameraOpen().catch((e) => { console.error(e) });
await window.plugins.theta.notificationAudioShutter().catch((e) => { console.error(e) });
await window.plugins.theta.notificationAudioOpen().catch((e) => { console.error(e) });
await window.plugins.theta.notificationAudioClose().catch((e) => { console.error(e) });
await window.plugins.theta.notificationAudioMovStart().catch((e) => { console.error(e) });
await window.plugins.theta.notificationAudioMovStop().catch((e) => { console.error(e) });
await window.plugins.theta.notificationAudioSelf().catch((e) => { console.error(e) });
await window.plugins.theta.notificationAudioWarning().catch((e) => { console.error(e) });
await window.plugins.theta.notificationLed3Show("RED").catch((e) => { console.error(e) });
await window.plugins.theta.notificationLedShow("LED3").catch((e) => { console.error(e) });
await window.plugins.theta.notificationLedBlink("LED3", "RED", 2000).catch((e) => { console.error(e) });
await window.plugins.theta.notificationLedHide("LED3").catch((e) => { console.error(e) });
await window.plugins.theta.notificationDatabaseUpdate(["/sdcard/DCIM"]).catch((e) => { console.error(e) });
await window.plugins.theta.notificationSuccess().catch((e) => { console.error(e) });
await window.plugins.theta.notificationError("message").catch((e) => { console.error(e) });
}catch (e) {
console.error("Received Event:", e);
}
}
};
app.initialize();