mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-06 07:37:19 +02:00
Support vibrating using Android API
This commit is contained in:
parent
357ee51999
commit
94bddb0740
@ -6173,6 +6173,11 @@ class VibrationManager {
|
||||
static #playDeviceVibration(data) {
|
||||
// console.log(+new Date, data);
|
||||
|
||||
if ('AndroidInterface' in window) {
|
||||
AndroidInterface.vibrate(JSON.stringify(data), window.BX_VIBRATION_INTENSITY);
|
||||
return;
|
||||
}
|
||||
|
||||
const intensity = Math.min(100, data.leftMotorPercent + data.rightMotorPercent / 2) * window.BX_VIBRATION_INTENSITY;
|
||||
if (intensity === 0 || intensity === 100) {
|
||||
// Stop vibration
|
||||
@ -10544,6 +10549,7 @@ div[data-testid="media-container"] {
|
||||
#game-stream video {
|
||||
margin: 0 auto;
|
||||
align-self: center;
|
||||
background: #000;
|
||||
${videoCss}
|
||||
}
|
||||
`;
|
||||
|
Loading…
x
Reference in New Issue
Block a user