Skip to content

Commit

Permalink
Release - 0.12.16 (#3116)
Browse files Browse the repository at this point in the history
  • Loading branch information
KaustubhKumar05 authored Jul 22, 2024
2 parents 5a03ea5 + dc626cd commit 580d445
Show file tree
Hide file tree
Showing 45 changed files with 840 additions and 156 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ on:
description: 'which version to bump eg: prerelease, patch'
required: true
default: 'prerelease'


jobs:
create_pr:
runs-on: ubuntu-latest
steps:
- name: Validate branch
if: github.event.inputs.versionBump != 'prerelease' && github.ref != 'refs/heads/main'
if: github.event.inputs.versionBump != 'prerelease' && github.ref != 'refs/heads/dev'
run: exit 1

- uses: actions/checkout@v3
Expand Down Expand Up @@ -46,10 +47,10 @@ jobs:
- uses: peter-evans/create-pull-request@v4
with:
commit-message: 'build: update versions for release'
title: 'build: update versions for release'
commit-message: 'ci: update versions for release'
title: 'ci: update versions for release'
body: |
- @100mslive/hms-video-store - ${{ steps.version.outputs.store_version }}
branch: release
branch: ci/release
branch-suffix: short-commit-hash
delete-branch: true
2 changes: 1 addition & 1 deletion examples/prebuilt-react-integration/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/hls-player/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/hls-stats/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/hms-video-store/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ export class RoomUpdateManager {
this.listener?.onRoomUpdate(HMSRoomUpdate.TRANSCRIPTION_STATE_UPDATED, room);
}
private convertHls(hlsNotification?: HLSNotification) {
// only checking for zeroth variant intialized
const isInitialised =
hlsNotification?.variants && hlsNotification.variants.length > 0
? hlsNotification.variants.some(variant => variant.state === HMSStreamingState.INITIALISED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export class HMSAudioPluginsManager {
this.pluginsMap.set(name, plugin);
await this.processPlugin(plugin);
await this.connectToDestination();
await this.updateProcessedTrack();
} catch (err) {
HMSLogger.e(this.TAG, 'failed to add plugin', err);
throw err;
Expand Down Expand Up @@ -213,6 +214,7 @@ export class HMSAudioPluginsManager {
for (const plugin of plugins) {
await this.addPlugin(plugin);
}
this.updateProcessedTrack();
}

private async initAudioNodes() {
Expand All @@ -224,16 +226,19 @@ export class HMSAudioPluginsManager {
if (!this.destinationNode) {
this.destinationNode = this.audioContext.createMediaStreamDestination();
this.outputTrack = this.destinationNode.stream.getAudioTracks()[0];
try {
await this.hmsTrack.setProcessedTrack(this.outputTrack);
} catch (err) {
HMSLogger.e(this.TAG, 'error in setting processed track', err);
throw err;
}
}
}
}

private async updateProcessedTrack() {
try {
await this.hmsTrack.setProcessedTrack(this.outputTrack);
} catch (err) {
HMSLogger.e(this.TAG, 'error in setting processed track', err);
throw err;
}
}

private async processPlugin(plugin: HMSAudioPlugin) {
try {
const currentNode = await plugin.processAudioTrack(
Expand Down
7 changes: 7 additions & 0 deletions packages/hms-video-store/src/sdk/LocalTrackManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ export class LocalTrackManager {
}
});
}
// eslint-disable-next-line complexity
async getLocalScreen(partialConfig?: HMSScreenShareConfig, optimise = false) {
const config = await this.getOrDefaultScreenshareConfig(partialConfig);
const screenSettings = this.getScreenshareSettings(config.videoOnly);
Expand All @@ -218,6 +219,12 @@ export class LocalTrackManager {
googAutoGainControl: false,
echoCancellation: false,
};
} else if (partialConfig?.forceCurrentTab && partialConfig.preferCurrentTab && partialConfig.cropElement) {
// only need if crop element with prefer and force current tab
constraints.audio = {
echoCancellation: true,
noiseSuppression: true,
};
}
let stream;
try {
Expand Down
6 changes: 3 additions & 3 deletions packages/hms-virtual-background/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/hms-virtual-background/src/HMSEffectsPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type HMSEffectsBackground = string | MediaStream | MediaStreamTrack | HTM

export class HMSEffectsPlugin implements HMSMediaStreamPlugin {
private effects: tsvb;
// Ranges from 0 to 1
// Ranges from 0 to 1, inclusive
private blurAmount = 0;
private background: HMSEffectsBackground = HMSVirtualBackgroundTypes.NONE;
private backgroundType = HMSVirtualBackgroundTypes.NONE;
Expand Down
3 changes: 2 additions & 1 deletion packages/hms-whiteboard/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 14 additions & 13 deletions packages/hms-whiteboard/src/ErrorFallback.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import React, { ComponentType, useEffect, useLayoutEffect, useRef, useState } from 'react';
import { useValue } from '@tldraw/state';
import { Editor, hardResetEditor, refreshPage } from '@tldraw/tldraw';
import { Editor, hardResetEditor } from '@tldraw/tldraw';
import classNames from 'classnames';

const DISCORD_URL = 'https://discord.gg/pTge2BwDBq';

export type TLErrorFallbackComponent = ComponentType<{
error: unknown;
refresh: () => void;
editor?: Editor;
}>;

export const ErrorFallback: TLErrorFallbackComponent = ({ error, editor }) => {
export const ErrorFallback: TLErrorFallbackComponent = ({ error, editor, refresh }) => {
const containerRef = useRef<HTMLDivElement>(null);
const [shouldShowError, setShouldShowError] = useState(process.env.NODE_ENV !== 'production');
const [didCopy, setDidCopy] = useState(false);
Expand All @@ -24,7 +25,7 @@ export const ErrorFallback: TLErrorFallbackComponent = ({ error, editor }) => {
() => {
try {
if (editor) {
return editor.user.isDarkMode;
return editor.user.getIsDarkMode();
}
} catch {
// we're in a funky error state so this might not work for spooky
Expand All @@ -34,7 +35,11 @@ export const ErrorFallback: TLErrorFallbackComponent = ({ error, editor }) => {
},
[editor],
);
const [isDarkMode, setIsDarkMode] = useState<null | boolean>(null);
const [
,
// isDarkMode
setIsDarkMode,
] = useState<null | boolean>(null);
useLayoutEffect(() => {
// if we found a theme class from the app, we can just use that
if (isDarkModeFromApp !== null) {
Expand Down Expand Up @@ -81,10 +86,6 @@ export const ErrorFallback: TLErrorFallbackComponent = ({ error, editor }) => {
setDidCopy(true);
};

const refresh = () => {
refreshPage();
};

const resetLocalState = async () => {
hardResetEditor();
};
Expand All @@ -97,8 +98,11 @@ export const ErrorFallback: TLErrorFallbackComponent = ({ error, editor }) => {
// error-boundary is sometimes used outside of the theme
// container, so we need to provide it with a theme for our
// styles to work correctly
isDarkMode === null ? '' : isDarkMode ? 'tl-theme__dark' : 'tl-theme__light',
// 100ms: default light theme
// isDarkMode === null ? '' : isDarkMode ? 'tl-theme__dark' : 'tl-theme__light',
'tl-theme__light',
)}
style={{ position: 'static' }}
>
<div className="tl-error-boundary__overlay" />
{/* {editor && (
Expand Down Expand Up @@ -152,11 +156,8 @@ export const ErrorFallback: TLErrorFallbackComponent = ({ error, editor }) => {
{shouldShowError ? 'Hide details' : 'Show details'}
</button>
<div className="tl-error-boundary__content__actions__group">
<button className="tl-error-boundary__reset" onClick={() => setShouldShowResetConfirmation(true)}>
Reset data
</button>
<button className="tl-error-boundary__refresh" onClick={refresh}>
Refresh Page
Refresh
</button>
</div>
</div>
Expand Down
23 changes: 21 additions & 2 deletions packages/hms-whiteboard/src/Whiteboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,20 @@ export interface WhiteboardProps {
transparentCanvas?: boolean;
onMount?: (args: { store?: unknown; editor?: unknown }) => void;
}
export function Whiteboard({ endpoint, token, zoomToContent, transparentCanvas, onMount }: WhiteboardProps) {
export function Whiteboard(props: WhiteboardProps) {
const [key, setKey] = useState(Date.now() + props.token);

return <CollaborativeEditor key={key} refresh={() => setKey(Date.now() + props.token)} {...props} />;
}

function CollaborativeEditor({
endpoint,
token,
zoomToContent,
transparentCanvas,
onMount,
refresh,
}: WhiteboardProps & { refresh: () => void }) {
const [editor, setEditor] = useState<Editor>();
const store = useCollaboration({
endpoint,
Expand All @@ -27,13 +40,19 @@ export function Whiteboard({ endpoint, token, zoomToContent, transparentCanvas,
onMount?.({ store: store.store, editor });
};

if (store.status === 'synced-remote' && store.connectionStatus === 'offline') {
return <ErrorFallback error={Error('Network connection lost')} editor={editor} refresh={refresh} />;
}

return (
<Tldraw
className={transparentCanvas ? 'transparent-canvas' : ''}
autoFocus
store={store}
onMount={handleMount}
components={{ ErrorFallback }}
components={{
ErrorFallback: ({ error, editor }) => <ErrorFallback editor={editor} error={error} refresh={refresh} />,
}}
hideUi={editor?.getInstanceState()?.isReadonly}
initialState={editor?.getInstanceState()?.isReadonly ? 'hand' : 'select'}
/>
Expand Down
Loading

0 comments on commit 580d445

Please sign in to comment.