@limrun/ui 0.4.0-rc.1 → 0.4.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limrun/ui",
3
- "version": "0.4.0-rc.1",
3
+ "version": "0.4.0-rc.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -96,7 +96,7 @@ const deviceConfig = {
96
96
  frameImage: pixelFrameImage,
97
97
  frameWidthMultiplier: 1.107,
98
98
  videoBorderRadiusMultiplier: 0.137,
99
- loadingLogo: null,
99
+ loadingLogo: undefined,
100
100
  },
101
101
  };
102
102
 
@@ -780,7 +780,12 @@ export const RemoteControl = forwardRef<RemoteControlHandle, RemoteControlProps>
780
780
  const resizeObserver = new ResizeObserver((entries) => {
781
781
  for (const entry of entries) {
782
782
  const videoWidth = entry.contentRect.width;
783
- frame.style.width = `${videoWidth * config.frameWidthMultiplier}px`;
783
+ const originalFrameWidth = frame.clientWidth;
784
+ const newFrameWidth = videoWidth * config.frameWidthMultiplier;
785
+ // The video is too small up until the first frame is visible, so we need to make sure we don't scale the frame down too much.
786
+ if (newFrameWidth > 0.9*originalFrameWidth) {
787
+ frame.style.width = `${videoWidth * config.frameWidthMultiplier}px`;
788
+ }
784
789
  video.style.borderRadius = `${videoWidth * config.videoBorderRadiusMultiplier}px`;
785
790
  }
786
791
  });
@@ -931,12 +936,12 @@ export const RemoteControl = forwardRef<RemoteControlHandle, RemoteControlProps>
931
936
  style={
932
937
  config.loadingLogo
933
938
  ? {
934
- backgroundImage: `url(${config.loadingLogo})`,
939
+ backgroundImage: `url("${config.loadingLogo}")`,
935
940
  backgroundRepeat: 'no-repeat',
936
941
  backgroundPosition: 'center',
937
942
  backgroundSize: '20%',
938
943
  }
939
- : undefined
944
+ : {}
940
945
  }
941
946
  autoPlay
942
947
  playsInline
package/src/demo.tsx CHANGED
@@ -3,8 +3,8 @@ import { createRoot } from 'react-dom/client';
3
3
  import { RemoteControl, RemoteControlHandle } from './components/remote-control';
4
4
 
5
5
  function Demo() {
6
- const [url, setUrl] = useState('wss://eu-hel1-5-staging.limrun.dev/v1/organizations/org_01k3v8bvxvecfvscdhvcp3rga1/ios.limrun.com/v1/instances/ios_eustg_01kd5hvbcmf7krej28t927cskb/endpointWebSocket');
7
- const [token, setToken] = useState('lim_c8a8f9a45008ee01441fbd01f41d5f1b04eac8c4fc3f20de');
6
+ const [url, setUrl] = useState('wss://eu-hel1-5-staging.limrun.dev/v1/organizations/org_01k3v8bvxvecfvscdhvcp3rga1/ios.limrun.com/v1/instances/ios_eustg_01kd5mjeb7fnc8d4yc3f8j8c37/endpointWebSocket');
7
+ const [token, setToken] = useState('lim_3f6fc1574c8be1ee23afffe3601512d42f9b2ed486c7320a');
8
8
  const [platform, setPlatform] = useState<'ios' | 'android'>('ios');
9
9
  const [isConnected, setIsConnected] = useState(false);
10
10
  const [key, setKey] = useState(0);