mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-07 08:07:18 +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) {
|
static #playDeviceVibration(data) {
|
||||||
// console.log(+new Date, 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;
|
const intensity = Math.min(100, data.leftMotorPercent + data.rightMotorPercent / 2) * window.BX_VIBRATION_INTENSITY;
|
||||||
if (intensity === 0 || intensity === 100) {
|
if (intensity === 0 || intensity === 100) {
|
||||||
// Stop vibration
|
// Stop vibration
|
||||||
@ -10544,6 +10549,7 @@ div[data-testid="media-container"] {
|
|||||||
#game-stream video {
|
#game-stream video {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
|
background: #000;
|
||||||
${videoCss}
|
${videoCss}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user