@camera.ui/browser 0.1.15 → 0.1.17
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/dist/index.d.ts +13 -201
- package/dist/index.js +59 -11
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -217,6 +217,7 @@ export declare interface CameraStream {
|
|
|
217
217
|
readonly unsupported: Ref<boolean>;
|
|
218
218
|
readonly hasAudio: Ref<boolean>;
|
|
219
219
|
readonly hasBackchannel: Ref<boolean>;
|
|
220
|
+
readonly hasMicrophone: Ref<boolean>;
|
|
220
221
|
readonly error: Ref<Error | undefined>;
|
|
221
222
|
readonly isReconnecting: Ref<boolean>;
|
|
222
223
|
readonly activityMode: Ref<CameraActivityMode>;
|
|
@@ -648,6 +649,10 @@ export declare class NamespaceManager {
|
|
|
648
649
|
return `plugin.${pluginId}.fileserve.rpc`;
|
|
649
650
|
}
|
|
650
651
|
|
|
652
|
+
static pluginPipeRpc(pluginId: string): string {
|
|
653
|
+
return `plugin.${pluginId}.pipe.rpc`;
|
|
654
|
+
}
|
|
655
|
+
|
|
651
656
|
static cameraNamespaces(cameraId: string): CameraNamespaces {
|
|
652
657
|
return {
|
|
653
658
|
cameraSubject: `camera.${cameraId}.subscriber`,
|
|
@@ -771,6 +776,11 @@ export declare class NamespaceManager {
|
|
|
771
776
|
}
|
|
772
777
|
}
|
|
773
778
|
|
|
779
|
+
export declare interface NativeFullscreen {
|
|
780
|
+
enter: () => Promise<boolean>;
|
|
781
|
+
exit: () => Promise<void>;
|
|
782
|
+
}
|
|
783
|
+
|
|
774
784
|
export { NatsStatus }
|
|
775
785
|
|
|
776
786
|
declare interface NotificationManagerNamespaces {
|
|
@@ -1129,6 +1139,7 @@ export declare interface ReactiveStream {
|
|
|
1129
1139
|
readonly hasVideo: Ref<boolean>;
|
|
1130
1140
|
readonly hasAudio: Ref<boolean>;
|
|
1131
1141
|
readonly hasBackchannel: Ref<boolean>;
|
|
1142
|
+
readonly hasMicrophone?: Readonly<Ref<boolean>>;
|
|
1132
1143
|
readonly isPlaying: Ref<boolean>;
|
|
1133
1144
|
readonly stalled?: Ref<boolean>;
|
|
1134
1145
|
readonly connectionPath?: Readonly<Ref<StreamConnectionPath | undefined>>;
|
|
@@ -1298,6 +1309,8 @@ export declare interface SensorRegistryRPC {
|
|
|
1298
1309
|
|
|
1299
1310
|
export declare function setFullscreenRoot(el: HTMLElement | null): void;
|
|
1300
1311
|
|
|
1312
|
+
export declare function setNativeFullscreen(native: NativeFullscreen | null): void;
|
|
1313
|
+
|
|
1301
1314
|
/* Excluded from this release type: SirenControlProperties */
|
|
1302
1315
|
|
|
1303
1316
|
/* Excluded from this release type: SirenProperty */
|
|
@@ -1712,204 +1725,3 @@ declare module 'fastify' {
|
|
|
1712
1725
|
uploadToDisk?: boolean;
|
|
1713
1726
|
}
|
|
1714
1727
|
}
|
|
1715
|
-
|
|
1716
|
-
/**
|
|
1717
|
-
* Copyright (c) 2017, Daniel Imms (MIT License).
|
|
1718
|
-
* Copyright (c) 2018, Microsoft Corporation (MIT License).
|
|
1719
|
-
*/
|
|
1720
|
-
|
|
1721
|
-
declare module '@scrypted/node-pty' {
|
|
1722
|
-
/**
|
|
1723
|
-
* Forks a process as a pseudoterminal.
|
|
1724
|
-
* @param file The file to launch.
|
|
1725
|
-
* @param args The file's arguments as argv (string[]) or in a pre-escaped CommandLine format
|
|
1726
|
-
* (string). Note that the CommandLine option is only available on Windows and is expected to be
|
|
1727
|
-
* escaped properly.
|
|
1728
|
-
* @param options The options of the terminal.
|
|
1729
|
-
* @see CommandLineToArgvW https://msdn.microsoft.com/en-us/library/windows/desktop/bb776391(v=vs.85).aspx
|
|
1730
|
-
* @see Parsing C++ Comamnd-Line Arguments https://msdn.microsoft.com/en-us/library/17w5ykft.aspx
|
|
1731
|
-
* @see GetCommandLine https://msdn.microsoft.com/en-us/library/windows/desktop/ms683156.aspx
|
|
1732
|
-
*/
|
|
1733
|
-
export function spawn(file: string, args: string[] | string, options: IPtyForkOptions | IWindowsPtyForkOptions): IPty;
|
|
1734
|
-
|
|
1735
|
-
export interface IBasePtyForkOptions {
|
|
1736
|
-
/**
|
|
1737
|
-
* Name of the terminal to be set in environment ($TERM variable).
|
|
1738
|
-
*/
|
|
1739
|
-
name?: string;
|
|
1740
|
-
|
|
1741
|
-
/**
|
|
1742
|
-
* Number of intial cols of the pty.
|
|
1743
|
-
*/
|
|
1744
|
-
cols?: number;
|
|
1745
|
-
|
|
1746
|
-
/**
|
|
1747
|
-
* Number of initial rows of the pty.
|
|
1748
|
-
*/
|
|
1749
|
-
rows?: number;
|
|
1750
|
-
|
|
1751
|
-
/**
|
|
1752
|
-
* Working directory to be set for the child program.
|
|
1753
|
-
*/
|
|
1754
|
-
cwd?: string;
|
|
1755
|
-
|
|
1756
|
-
/**
|
|
1757
|
-
* Environment to be set for the child program.
|
|
1758
|
-
*/
|
|
1759
|
-
env?: Record<string, string | undefined>;
|
|
1760
|
-
|
|
1761
|
-
/**
|
|
1762
|
-
* String encoding of the underlying pty.
|
|
1763
|
-
* If set, incoming data will be decoded to strings and outgoing strings to bytes applying this encoding.
|
|
1764
|
-
* If unset, incoming data will be delivered as raw bytes (Buffer type).
|
|
1765
|
-
* By default 'utf8' is assumed, to unset it explicitly set it to `null`.
|
|
1766
|
-
*/
|
|
1767
|
-
encoding?: string | null;
|
|
1768
|
-
|
|
1769
|
-
/**
|
|
1770
|
-
* (EXPERIMENTAL)
|
|
1771
|
-
* Whether to enable flow control handling (false by default). If enabled a message of `flowControlPause`
|
|
1772
|
-
* will pause the socket and thus blocking the child program execution due to buffer back pressure.
|
|
1773
|
-
* A message of `flowControlResume` will resume the socket into flow mode.
|
|
1774
|
-
* For performance reasons only a single message as a whole will match (no message part matching).
|
|
1775
|
-
* If flow control is enabled the `flowControlPause` and `flowControlResume` messages are not forwarded to
|
|
1776
|
-
* the underlying pseudoterminal.
|
|
1777
|
-
*/
|
|
1778
|
-
handleFlowControl?: boolean;
|
|
1779
|
-
|
|
1780
|
-
/**
|
|
1781
|
-
* (EXPERIMENTAL)
|
|
1782
|
-
* The string that should pause the pty when `handleFlowControl` is true. Default is XOFF ('\x13').
|
|
1783
|
-
*/
|
|
1784
|
-
flowControlPause?: string;
|
|
1785
|
-
|
|
1786
|
-
/**
|
|
1787
|
-
* (EXPERIMENTAL)
|
|
1788
|
-
* The string that should resume the pty when `handleFlowControl` is true. Default is XON ('\x11').
|
|
1789
|
-
*/
|
|
1790
|
-
flowControlResume?: string;
|
|
1791
|
-
}
|
|
1792
|
-
|
|
1793
|
-
export interface IPtyForkOptions extends IBasePtyForkOptions {
|
|
1794
|
-
/**
|
|
1795
|
-
* Security warning: use this option with great caution,
|
|
1796
|
-
* as opened file descriptors with higher privileges might leak to the child program.
|
|
1797
|
-
*/
|
|
1798
|
-
uid?: number;
|
|
1799
|
-
gid?: number;
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1802
|
-
export interface IWindowsPtyForkOptions extends IBasePtyForkOptions {
|
|
1803
|
-
/**
|
|
1804
|
-
* Whether to use the ConPTY system on Windows. When this is not set, ConPTY will be used when
|
|
1805
|
-
* the Windows build number is >= 18309 (instead of winpty). Note that ConPTY is available from
|
|
1806
|
-
* build 17134 but is too unstable to enable by default.
|
|
1807
|
-
*
|
|
1808
|
-
* This setting does nothing on non-Windows.
|
|
1809
|
-
*/
|
|
1810
|
-
useConpty?: boolean;
|
|
1811
|
-
|
|
1812
|
-
/**
|
|
1813
|
-
* Whether to use PSEUDOCONSOLE_INHERIT_CURSOR in conpty.
|
|
1814
|
-
* @see https://docs.microsoft.com/en-us/windows/console/createpseudoconsole
|
|
1815
|
-
*/
|
|
1816
|
-
conptyInheritCursor?: boolean;
|
|
1817
|
-
}
|
|
1818
|
-
|
|
1819
|
-
/**
|
|
1820
|
-
* An interface representing a pseudoterminal, on Windows this is emulated via the winpty library.
|
|
1821
|
-
*/
|
|
1822
|
-
export interface IPty {
|
|
1823
|
-
/**
|
|
1824
|
-
* The process ID of the outer process.
|
|
1825
|
-
*/
|
|
1826
|
-
readonly pid: number;
|
|
1827
|
-
|
|
1828
|
-
/**
|
|
1829
|
-
* The column size in characters.
|
|
1830
|
-
*/
|
|
1831
|
-
readonly cols: number;
|
|
1832
|
-
|
|
1833
|
-
/**
|
|
1834
|
-
* The row size in characters.
|
|
1835
|
-
*/
|
|
1836
|
-
readonly rows: number;
|
|
1837
|
-
|
|
1838
|
-
/**
|
|
1839
|
-
* The title of the active process.
|
|
1840
|
-
*/
|
|
1841
|
-
readonly process: string;
|
|
1842
|
-
|
|
1843
|
-
/**
|
|
1844
|
-
* (EXPERIMENTAL)
|
|
1845
|
-
* Whether to handle flow control. Useful to disable/re-enable flow control during runtime.
|
|
1846
|
-
* Use this for binary data that is likely to contain the `flowControlPause` string by accident.
|
|
1847
|
-
*/
|
|
1848
|
-
handleFlowControl: boolean;
|
|
1849
|
-
|
|
1850
|
-
/**
|
|
1851
|
-
* Adds an event listener for when a data event fires. This happens when data is returned from
|
|
1852
|
-
* the pty.
|
|
1853
|
-
* @returns an `IDisposable` to stop listening.
|
|
1854
|
-
*/
|
|
1855
|
-
readonly onData: IEvent<string>;
|
|
1856
|
-
|
|
1857
|
-
/**
|
|
1858
|
-
* Adds an event listener for when an exit event fires. This happens when the pty exits.
|
|
1859
|
-
* @returns an `IDisposable` to stop listening.
|
|
1860
|
-
*/
|
|
1861
|
-
readonly onExit: IEvent<{ exitCode: number; signal?: number }>;
|
|
1862
|
-
|
|
1863
|
-
/**
|
|
1864
|
-
* Resizes the dimensions of the pty.
|
|
1865
|
-
* @param columns The number of columns to use.
|
|
1866
|
-
* @param rows The number of rows to use.
|
|
1867
|
-
*/
|
|
1868
|
-
resize(columns: number, rows: number): void;
|
|
1869
|
-
|
|
1870
|
-
/**
|
|
1871
|
-
* Clears the pty's internal representation of its buffer. This is a no-op
|
|
1872
|
-
* unless on Windows/ConPTY. This is useful if the buffer is cleared on the
|
|
1873
|
-
* frontend in order to synchronize state with the backend to avoid ConPTY
|
|
1874
|
-
* possibly reprinting the screen.
|
|
1875
|
-
*/
|
|
1876
|
-
clear(): void;
|
|
1877
|
-
|
|
1878
|
-
/**
|
|
1879
|
-
* Writes data to the pty.
|
|
1880
|
-
* @param data The data to write.
|
|
1881
|
-
*/
|
|
1882
|
-
write(data: string): void;
|
|
1883
|
-
|
|
1884
|
-
/**
|
|
1885
|
-
* Kills the pty.
|
|
1886
|
-
* @param signal The signal to use, defaults to SIGHUP. This parameter is not supported on
|
|
1887
|
-
* Windows.
|
|
1888
|
-
* @throws Will throw when signal is used on Windows.
|
|
1889
|
-
*/
|
|
1890
|
-
kill(signal?: string): void;
|
|
1891
|
-
|
|
1892
|
-
/**
|
|
1893
|
-
* Pauses the pty for customizable flow control.
|
|
1894
|
-
*/
|
|
1895
|
-
pause(): void;
|
|
1896
|
-
|
|
1897
|
-
/**
|
|
1898
|
-
* Resumes the pty for customizable flow control.
|
|
1899
|
-
*/
|
|
1900
|
-
resume(): void;
|
|
1901
|
-
}
|
|
1902
|
-
|
|
1903
|
-
/**
|
|
1904
|
-
* An object that can be disposed via a dispose function.
|
|
1905
|
-
*/
|
|
1906
|
-
export interface IDisposable {
|
|
1907
|
-
dispose(): void;
|
|
1908
|
-
}
|
|
1909
|
-
|
|
1910
|
-
/**
|
|
1911
|
-
* An event that can be listened to.
|
|
1912
|
-
* @returns an `IDisposable` to stop listening.
|
|
1913
|
-
*/
|
|
1914
|
-
export type IEvent<T> = (listener: (e: T) => any) => IDisposable;
|
|
1915
|
-
}
|
package/dist/index.js
CHANGED
|
@@ -160,6 +160,9 @@ var NamespaceManager = class {
|
|
|
160
160
|
static pluginFileServeRpc(pluginId) {
|
|
161
161
|
return `plugin.${pluginId}.fileserve.rpc`;
|
|
162
162
|
}
|
|
163
|
+
static pluginPipeRpc(pluginId) {
|
|
164
|
+
return `plugin.${pluginId}.pipe.rpc`;
|
|
165
|
+
}
|
|
163
166
|
static cameraNamespaces(cameraId) {
|
|
164
167
|
return {
|
|
165
168
|
cameraSubject: `camera.${cameraId}.subscriber`,
|
|
@@ -4657,6 +4660,7 @@ var StreamConnection = class {
|
|
|
4657
4660
|
hasVideo;
|
|
4658
4661
|
hasAudio;
|
|
4659
4662
|
hasBackchannel;
|
|
4663
|
+
hasMicrophone;
|
|
4660
4664
|
isPlaying;
|
|
4661
4665
|
stalled;
|
|
4662
4666
|
connectionPath;
|
|
@@ -4688,6 +4692,7 @@ var StreamConnection = class {
|
|
|
4688
4692
|
hiddenPauseRan = false;
|
|
4689
4693
|
disarmPipWatch = null;
|
|
4690
4694
|
wsHandle;
|
|
4695
|
+
streamRequested = false;
|
|
4691
4696
|
wsOpenedAt = 0;
|
|
4692
4697
|
webrtcHandler;
|
|
4693
4698
|
mseHandler;
|
|
@@ -4697,7 +4702,7 @@ var StreamConnection = class {
|
|
|
4697
4702
|
cancelFirstFrameWatch;
|
|
4698
4703
|
awaitingWebRTCFrame = false;
|
|
4699
4704
|
backchannelHandler;
|
|
4700
|
-
|
|
4705
|
+
micTrack = shallowRef(null);
|
|
4701
4706
|
offerPeer;
|
|
4702
4707
|
answeredPeer;
|
|
4703
4708
|
lastMediaStream = null;
|
|
@@ -4750,6 +4755,7 @@ var StreamConnection = class {
|
|
|
4750
4755
|
this.hasVideo = ref(false);
|
|
4751
4756
|
this.hasAudio = ref(false);
|
|
4752
4757
|
this.hasBackchannel = ref(false);
|
|
4758
|
+
this.hasMicrophone = computed(() => this.micTrack.value !== null);
|
|
4753
4759
|
this.isPlaying = ref(false);
|
|
4754
4760
|
this.stalled = ref(false);
|
|
4755
4761
|
this.webrtcUnreachable = ref(false);
|
|
@@ -4966,7 +4972,7 @@ var StreamConnection = class {
|
|
|
4966
4972
|
await this.start();
|
|
4967
4973
|
return;
|
|
4968
4974
|
}
|
|
4969
|
-
if (this.status.value === "connected") await this.restart();
|
|
4975
|
+
if (this.status.value === "connected" || this.streamRequested) await this.restart();
|
|
4970
4976
|
}
|
|
4971
4977
|
async setResolution(resolution) {
|
|
4972
4978
|
if (this.requestedResolution.value === resolution) return;
|
|
@@ -4982,7 +4988,7 @@ var StreamConnection = class {
|
|
|
4982
4988
|
this.activeResolution.value = result.effectiveResolution;
|
|
4983
4989
|
this.degradedFrom.value = result.degradedFrom;
|
|
4984
4990
|
this.degradeReason.value = result.degradedFrom ? "codec" : null;
|
|
4985
|
-
if (this.status.value === "connected") await this.restart();
|
|
4991
|
+
if (this.status.value === "connected" || this.wsHandle) await this.restart();
|
|
4986
4992
|
}
|
|
4987
4993
|
}
|
|
4988
4994
|
async setMicrophone(track) {
|
|
@@ -4991,7 +4997,7 @@ var StreamConnection = class {
|
|
|
4991
4997
|
return;
|
|
4992
4998
|
}
|
|
4993
4999
|
if (!this.hasBackchannel.value) return;
|
|
4994
|
-
this.
|
|
5000
|
+
this.micTrack.value = track;
|
|
4995
5001
|
if (!this.backchannelHandler) await this.startBackchannel();
|
|
4996
5002
|
else if (this.backchannelHandler.isConnected) await this.backchannelHandler.setMicrophoneTrack(track);
|
|
4997
5003
|
}
|
|
@@ -5046,7 +5052,7 @@ var StreamConnection = class {
|
|
|
5046
5052
|
this.scope.stop();
|
|
5047
5053
|
}
|
|
5048
5054
|
restart() {
|
|
5049
|
-
return this.reconnect(
|
|
5055
|
+
return this.reconnect(0);
|
|
5050
5056
|
}
|
|
5051
5057
|
invalidateProbe() {
|
|
5052
5058
|
this.probeInfo.value = void 0;
|
|
@@ -5101,7 +5107,7 @@ var StreamConnection = class {
|
|
|
5101
5107
|
}
|
|
5102
5108
|
retryAfterNoMedia() {
|
|
5103
5109
|
if (this.markSourceUndecodable()) {
|
|
5104
|
-
this.
|
|
5110
|
+
this.reconnect(RETRY_BASE_DELAY);
|
|
5105
5111
|
return;
|
|
5106
5112
|
}
|
|
5107
5113
|
this.retryLater(this.lastError);
|
|
@@ -5423,6 +5429,7 @@ var StreamConnection = class {
|
|
|
5423
5429
|
}
|
|
5424
5430
|
disconnectWebSocket() {
|
|
5425
5431
|
this.stopWsConnectTimeout();
|
|
5432
|
+
this.streamRequested = false;
|
|
5426
5433
|
if (this.wsHandle) {
|
|
5427
5434
|
this.wsHandle.dispose();
|
|
5428
5435
|
this.wsHandle = void 0;
|
|
@@ -5442,6 +5449,7 @@ var StreamConnection = class {
|
|
|
5442
5449
|
});
|
|
5443
5450
|
}
|
|
5444
5451
|
requestStream() {
|
|
5452
|
+
this.streamRequested = true;
|
|
5445
5453
|
if (this.sourceIsMjpeg()) {
|
|
5446
5454
|
this.startMjpeg();
|
|
5447
5455
|
return;
|
|
@@ -5737,7 +5745,7 @@ var StreamConnection = class {
|
|
|
5737
5745
|
if ((phase === "setup" || beforeFirstFrame) && this.sourceLikelyH265()) {
|
|
5738
5746
|
reportH265DecodeFailure("mse");
|
|
5739
5747
|
this.markSourceUndecodable();
|
|
5740
|
-
this.
|
|
5748
|
+
this.reconnect(RETRY_BASE_DELAY);
|
|
5741
5749
|
return;
|
|
5742
5750
|
}
|
|
5743
5751
|
if (phase === "setup") {
|
|
@@ -5956,7 +5964,7 @@ var StreamConnection = class {
|
|
|
5956
5964
|
value: candidate
|
|
5957
5965
|
}),
|
|
5958
5966
|
onConnected: async () => {
|
|
5959
|
-
if (this.
|
|
5967
|
+
if (this.micTrack.value && this.backchannelHandler === handler) await handler.setMicrophoneTrack(this.micTrack.value);
|
|
5960
5968
|
},
|
|
5961
5969
|
onFailed: () => this.closeBackchannel(handler)
|
|
5962
5970
|
});
|
|
@@ -5971,7 +5979,7 @@ var StreamConnection = class {
|
|
|
5971
5979
|
if (offer && !this.abortController.signal.aborted && this.backchannelHandler === handler) this.sendOffer(handler, offer);
|
|
5972
5980
|
}
|
|
5973
5981
|
resumeBackchannel() {
|
|
5974
|
-
if (this.
|
|
5982
|
+
if (this.micTrack.value && !this.backchannelHandler) this.startBackchannel();
|
|
5975
5983
|
}
|
|
5976
5984
|
sendOffer(peer, sdp) {
|
|
5977
5985
|
if (this.wsHandle?.readyState !== WebSocket.OPEN) return;
|
|
@@ -5993,7 +6001,7 @@ var StreamConnection = class {
|
|
|
5993
6001
|
handler?.close();
|
|
5994
6002
|
if (handler !== this.backchannelHandler) return;
|
|
5995
6003
|
this.backchannelHandler = void 0;
|
|
5996
|
-
this.
|
|
6004
|
+
this.micTrack.value = null;
|
|
5997
6005
|
}
|
|
5998
6006
|
};
|
|
5999
6007
|
function createStreamConnection(options) {
|
|
@@ -6161,16 +6169,46 @@ function restartConnectedStreams() {
|
|
|
6161
6169
|
return streamManager.restartConnected();
|
|
6162
6170
|
}
|
|
6163
6171
|
// src/composables/useFullscreen.ts
|
|
6172
|
+
var documentFullscreen = {
|
|
6173
|
+
async enter() {
|
|
6174
|
+
if (!document.fullscreenEnabled || document.fullscreenElement) return false;
|
|
6175
|
+
await document.documentElement.requestFullscreen({ navigationUI: "hide" });
|
|
6176
|
+
return true;
|
|
6177
|
+
},
|
|
6178
|
+
async exit() {
|
|
6179
|
+
if (document.fullscreenElement) await document.exitFullscreen();
|
|
6180
|
+
}
|
|
6181
|
+
};
|
|
6164
6182
|
var fsRegistry = /* @__PURE__ */ new WeakMap();
|
|
6165
6183
|
var fullscreenRoot = null;
|
|
6184
|
+
var nativeFullscreen = documentFullscreen;
|
|
6185
|
+
var nativeOwned = false;
|
|
6166
6186
|
function setFullscreenRoot(el) {
|
|
6167
6187
|
fullscreenRoot = el;
|
|
6168
6188
|
}
|
|
6189
|
+
function setNativeFullscreen(native) {
|
|
6190
|
+
nativeFullscreen = native;
|
|
6191
|
+
}
|
|
6169
6192
|
var fullscreenStack = [];
|
|
6170
6193
|
var topmostFullscreenWrapper = shallowRef(null);
|
|
6171
6194
|
function refreshTopmost() {
|
|
6172
6195
|
topmostFullscreenWrapper.value = fullscreenStack[fullscreenStack.length - 1] ?? null;
|
|
6173
6196
|
}
|
|
6197
|
+
function enterNative() {
|
|
6198
|
+
if (!nativeFullscreen || nativeOwned) return;
|
|
6199
|
+
nativeOwned = true;
|
|
6200
|
+
nativeFullscreen.enter().then((taken) => {
|
|
6201
|
+
nativeOwned = taken;
|
|
6202
|
+
exitNative();
|
|
6203
|
+
}, () => {
|
|
6204
|
+
nativeOwned = false;
|
|
6205
|
+
});
|
|
6206
|
+
}
|
|
6207
|
+
function exitNative() {
|
|
6208
|
+
if (!nativeOwned || fullscreenStack.length > 0) return;
|
|
6209
|
+
nativeOwned = false;
|
|
6210
|
+
nativeFullscreen?.exit();
|
|
6211
|
+
}
|
|
6174
6212
|
function useTopmostFullscreenElement() {
|
|
6175
6213
|
return computed(() => topmostFullscreenWrapper.value);
|
|
6176
6214
|
}
|
|
@@ -6184,9 +6222,13 @@ function useCuiFullscreen(target, options = {}) {
|
|
|
6184
6222
|
function onEscape(e) {
|
|
6185
6223
|
if (e.key === "Escape" && isFullscreen.value) exit();
|
|
6186
6224
|
}
|
|
6225
|
+
function onNativeChange() {
|
|
6226
|
+
if (nativeOwned && nativeFullscreen === documentFullscreen && !document.fullscreenElement) exit();
|
|
6227
|
+
}
|
|
6187
6228
|
async function enter() {
|
|
6188
6229
|
const el = currentEl.value;
|
|
6189
6230
|
if (!el || isFullscreen.value) return;
|
|
6231
|
+
enterNative();
|
|
6190
6232
|
const wrapper = document.createElement("div");
|
|
6191
6233
|
wrapper.className = `cui-fullscreen cui-fullscreen-${mode}`;
|
|
6192
6234
|
applyWrapperStyles(wrapper, mode);
|
|
@@ -6211,6 +6253,7 @@ function useCuiFullscreen(target, options = {}) {
|
|
|
6211
6253
|
behavior: "instant"
|
|
6212
6254
|
});
|
|
6213
6255
|
document.addEventListener("keydown", onEscape);
|
|
6256
|
+
document.addEventListener("fullscreenchange", onNativeChange);
|
|
6214
6257
|
fullscreenStack.push(wrapper);
|
|
6215
6258
|
refreshTopmost();
|
|
6216
6259
|
isFullscreen.value = true;
|
|
@@ -6232,9 +6275,11 @@ function useCuiFullscreen(target, options = {}) {
|
|
|
6232
6275
|
behavior: "instant"
|
|
6233
6276
|
});
|
|
6234
6277
|
document.removeEventListener("keydown", onEscape);
|
|
6278
|
+
document.removeEventListener("fullscreenchange", onNativeChange);
|
|
6235
6279
|
const stackIndex = fullscreenStack.indexOf(state.wrapper);
|
|
6236
6280
|
if (stackIndex !== -1) fullscreenStack.splice(stackIndex, 1);
|
|
6237
6281
|
refreshTopmost();
|
|
6282
|
+
exitNative();
|
|
6238
6283
|
isFullscreen.value = false;
|
|
6239
6284
|
}
|
|
6240
6285
|
async function toggle() {
|
|
@@ -6244,6 +6289,7 @@ function useCuiFullscreen(target, options = {}) {
|
|
|
6244
6289
|
tryOnScopeDispose(() => {
|
|
6245
6290
|
if (isFullscreen.value && currentEl.value) exit();
|
|
6246
6291
|
document.removeEventListener("keydown", onEscape);
|
|
6292
|
+
document.removeEventListener("fullscreenchange", onNativeChange);
|
|
6247
6293
|
});
|
|
6248
6294
|
return {
|
|
6249
6295
|
isFullscreen: computed(() => isFullscreen.value),
|
|
@@ -6363,6 +6409,7 @@ function useCameraStream(options) {
|
|
|
6363
6409
|
const unsupported = computed(() => status.value === "unsupported");
|
|
6364
6410
|
const hasAudio = computed(() => currentStream.value?.hasAudio.value ?? false);
|
|
6365
6411
|
const hasBackchannel = computed(() => currentStream.value?.hasBackchannel.value ?? false);
|
|
6412
|
+
const hasMicrophone = computed(() => currentStream.value?.hasMicrophone?.value ?? false);
|
|
6366
6413
|
const error = computed(() => currentStream.value?.error.value);
|
|
6367
6414
|
const isReconnecting = computed(() => status.value === "reconnecting");
|
|
6368
6415
|
const isBusy = computed(() => cameraDeviceLoading.value || !isPlaying.value && status.value !== "error" && status.value !== "unsupported");
|
|
@@ -6916,6 +6963,7 @@ function useCameraStream(options) {
|
|
|
6916
6963
|
unsupported,
|
|
6917
6964
|
hasAudio,
|
|
6918
6965
|
hasBackchannel,
|
|
6966
|
+
hasMicrophone,
|
|
6919
6967
|
error,
|
|
6920
6968
|
isReconnecting,
|
|
6921
6969
|
activityMode: activityModeManager.mode,
|
|
@@ -7180,4 +7228,4 @@ function useTerminalSessions() {
|
|
|
7180
7228
|
function terminalProxy(r) {
|
|
7181
7229
|
return r.createProxy(NamespaceManager.terminalManagerNamespaces().terminalManagerRpc);
|
|
7182
7230
|
}
|
|
7183
|
-
export { CAMERA_UI_INJECTION_KEY, NamespaceManager, STREAM_CONFIG, acquireSensorManager, clearCameraCache, clearOAuthCache, clearPluginCache, clearSensorCache, clearSnapshotCache, clearStorageCache, createActivityMode, createCameraUiPlugin, createReactiveCameraDevice, createSensorManager, getSnapshotUrl, isReactiveAudioSensor, isReactiveBatteryInfo, isReactiveCarbonDioxideInfo, isReactiveCarbonMonoxideSensor, isReactiveClassifierSensor, isReactiveColdSensor, isReactiveContactSensor, isReactiveDoorbellTrigger, isReactiveFaceSensor, isReactiveGarageControl, isReactiveGasSensor, isReactiveHeatSensor, isReactiveHumidityInfo, isReactiveIlluminanceInfo, isReactiveLeakSensor, isReactiveLicensePlateSensor, isReactiveLightControl, isReactiveLockControl, isReactiveMotionSensor, isReactiveObjectSensor, isReactiveOccupancySensor, isReactivePTZControl, isReactivePowerSensor, isReactiveProblemSensor, isReactiveSecuritySystem, isReactiveSirenControl, isReactiveSmokeSensor, isReactiveSwitchControl, isReactiveTamperSensor, isReactiveTemperatureInfo, isReactiveVibrationSensor, refreshClientSubscriptions, releaseSensorManager, resetClientState, restartConnectedStreams, rpcCall, setFullscreenRoot, useAllSensors, useAudioSensor, useCameraById, useCameraStorage, useCameraStream, useCameraUi, useClassifierSensors, useCoreManager, useCuiFullscreen, useDeviceManager, useFaceSensor, useLicensePlateSensor, useMotionSensor, useOAuth, useObjectSensor, usePTZControl, usePlugin, usePluginStorage, useRpcCall, useRpcSubscription, useSensorById, useSensorByType, useSensorStorage, useSensors, useSensorsByType, useSnapshot, useTabVisibility, useTerminal, useTerminalSessions, useTopmostFullscreenElement };
|
|
7231
|
+
export { CAMERA_UI_INJECTION_KEY, NamespaceManager, STREAM_CONFIG, acquireSensorManager, clearCameraCache, clearOAuthCache, clearPluginCache, clearSensorCache, clearSnapshotCache, clearStorageCache, createActivityMode, createCameraUiPlugin, createReactiveCameraDevice, createSensorManager, getSnapshotUrl, isReactiveAudioSensor, isReactiveBatteryInfo, isReactiveCarbonDioxideInfo, isReactiveCarbonMonoxideSensor, isReactiveClassifierSensor, isReactiveColdSensor, isReactiveContactSensor, isReactiveDoorbellTrigger, isReactiveFaceSensor, isReactiveGarageControl, isReactiveGasSensor, isReactiveHeatSensor, isReactiveHumidityInfo, isReactiveIlluminanceInfo, isReactiveLeakSensor, isReactiveLicensePlateSensor, isReactiveLightControl, isReactiveLockControl, isReactiveMotionSensor, isReactiveObjectSensor, isReactiveOccupancySensor, isReactivePTZControl, isReactivePowerSensor, isReactiveProblemSensor, isReactiveSecuritySystem, isReactiveSirenControl, isReactiveSmokeSensor, isReactiveSwitchControl, isReactiveTamperSensor, isReactiveTemperatureInfo, isReactiveVibrationSensor, refreshClientSubscriptions, releaseSensorManager, resetClientState, restartConnectedStreams, rpcCall, setFullscreenRoot, setNativeFullscreen, useAllSensors, useAudioSensor, useCameraById, useCameraStorage, useCameraStream, useCameraUi, useClassifierSensors, useCoreManager, useCuiFullscreen, useDeviceManager, useFaceSensor, useLicensePlateSensor, useMotionSensor, useOAuth, useObjectSensor, usePTZControl, usePlugin, usePluginStorage, useRpcCall, useRpcSubscription, useSensorById, useSensorByType, useSensorStorage, useSensors, useSensorsByType, useSnapshot, useTabVisibility, useTerminal, useTerminalSessions, useTopmostFullscreenElement };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camera.ui/browser",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"description": "camera.ui browser client",
|
|
5
5
|
"author": "seydx (https://github.com/cameraui/clients)",
|
|
6
6
|
"type": "module",
|
|
@@ -38,15 +38,15 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@camera.ui/logger": "file:../../packages/logger",
|
|
41
|
-
"@camera.ui/rpc": "^1.1.
|
|
42
|
-
"@camera.ui/sdk": "~1.4.
|
|
41
|
+
"@camera.ui/rpc": "^1.1.3",
|
|
42
|
+
"@camera.ui/sdk": "~1.4.11",
|
|
43
43
|
"@camera.ui/transport": "file:../../packages/transport",
|
|
44
44
|
"@eneris/push-receiver": "^4.4.0",
|
|
45
45
|
"@microsoft/api-extractor": "^7.60.1",
|
|
46
|
-
"@stylistic/eslint-plugin": "^
|
|
46
|
+
"@stylistic/eslint-plugin": "^6.0.0",
|
|
47
47
|
"@types/webrtc": "^0.0.47",
|
|
48
48
|
"@typescript-eslint/parser": "^8.72.2",
|
|
49
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
49
|
+
"@vitejs/plugin-vue": "^6.0.11",
|
|
50
50
|
"@vue/eslint-config-prettier": "^10.2.0",
|
|
51
51
|
"@vue/eslint-config-typescript": "^14.9.0",
|
|
52
52
|
"@vue/language-core": "^3.3.14",
|
|
@@ -56,13 +56,13 @@
|
|
|
56
56
|
"eslint": "9.39.2",
|
|
57
57
|
"eslint-plugin-vue": "^10.12.1",
|
|
58
58
|
"globals": "^17.14.0",
|
|
59
|
-
"prettier": "^3.
|
|
59
|
+
"prettier": "^3.10.1",
|
|
60
60
|
"rimraf": "^6.1.4",
|
|
61
61
|
"typescript": "5.9.3",
|
|
62
62
|
"typescript-eslint": "^8.72.2",
|
|
63
63
|
"unplugin-dts": "^1.1.2",
|
|
64
64
|
"updates": "^20.0.1",
|
|
65
|
-
"vite": "^8.3.
|
|
65
|
+
"vite": "^8.3.8",
|
|
66
66
|
"vitest": "^5.1.0",
|
|
67
67
|
"vue": "^3.5.45",
|
|
68
68
|
"vue-tsc": "3.3.11"
|