21 lines
494 B
Plaintext
21 lines
494 B
Plaintext
|
var HapticsPlugin = {
|
||
|
HapticFeedback: function(duration) {
|
||
|
try {
|
||
|
if (navigator.vibrate) {
|
||
|
navigator.vibrate(duration);
|
||
|
return true;
|
||
|
}
|
||
|
return false;
|
||
|
} catch(e) {
|
||
|
console.error('Haptic feedback error:', e);
|
||
|
return false;
|
||
|
}
|
||
|
},
|
||
|
|
||
|
IsHapticSupported: function() {
|
||
|
return (navigator.vibrate) ? 1 : 0;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
mergeInto(LibraryManager.library, HapticsPlugin);
|