Skip to content

Commit

Permalink
Release - 0.12.19
Browse files Browse the repository at this point in the history
  • Loading branch information
raviteja83 authored Sep 9, 2024
2 parents a015a71 + 27c41e9 commit b1bdfdb
Show file tree
Hide file tree
Showing 75 changed files with 1,328 additions and 398 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ on:
versionBump:
description: 'which version to bump eg: prerelease, patch'
required: true
type: choice
default: 'prerelease'

options:
- prerelease
- patch

jobs:
create_pr:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Update API Reference
on:
workflow_dispatch:
workflow_call:
secrets:
DOCKER_GIT_TOKEN:
required: true

jobs:
generate_api_reference:
Expand Down
17 changes: 14 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ on:
workflow_dispatch:
inputs:
publishFlag:
description: 'which version to publish eg: alpha, beta, latest, experimental'
description: 'which version to publish eg: alpha, latest'
required: true
default: 'alpha'
type: choice
options:
- alpha
- latest
repository_dispatch:
types: [publish-command]

Expand Down Expand Up @@ -64,8 +68,8 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
PUBLISH_FLAG: ${{ github.event.inputs.publishFlag || github.event.client_payload.slash_command.args.unnamed.arg1 || 'alpha' }}

- name: Delay for 1 minute
run: sleep 60
- name: Delay for 15s
run: sleep 15

- name: Notify slack success
if: github.event.inputs.publishFlag == 'latest' && success()
Expand All @@ -89,6 +93,13 @@ jobs:
status: Failed
color: danger

run_api_reference:
needs: publish_packages
if: github.event.inputs.publishFlag == 'latest'
uses: ./.github/workflows/generate-docs.yml
secrets:
DOCKER_GIT_TOKEN: ${{ secrets.DOCKER_GIT_TOKEN}}

notify_100ms_links:
runs-on: ubuntu-latest
needs: publish_packages
Expand Down
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.

19 changes: 18 additions & 1 deletion examples/prebuilt-react-integration/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';
import { basename } from 'path';
import fs from 'fs';

// Context: https://github.com/tensorflow/tfjs/issues/7165
function mediapipe_workaround() {
return {
name: 'mediapipe_workaround',
load(id) {
if (basename(id) === 'selfie_segmentation.js') {
let code = fs.readFileSync(id, 'utf-8');
code += 'exports.SelfieSegmentation = SelfieSegmentation;';
return { code };
}
return null;
},
};
}

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
plugins: [react(), mediapipe_workaround()],
define: {
'process.env': {},
},
Expand Down
3 changes: 2 additions & 1 deletion 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.

3 changes: 2 additions & 1 deletion packages/hls-stats/src/adapters/BaseAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ import { HlsPlayerStats } from '../interfaces';
export abstract class BaseAdapter {
hlsInstance: Hls;
videoEl: HTMLVideoElement;
hlsStatsState: HlsPlayerStats = {};
hlsStatsState: HlsPlayerStats;
constructor(hlsInstance: Hls, videoEl: HTMLVideoElement) {
this.hlsInstance = hlsInstance;
this.videoEl = videoEl;
this.hlsStatsState = {};
}
abstract startGatheringStats(): void;
abstract finishGatheringStats(): void;
Expand Down
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.

7 changes: 7 additions & 0 deletions packages/hms-video-store/src/IHMSActions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { HMSDiagnosticsInterface } from './diagnostics/interfaces';
import { TranscriptionConfig } from './interfaces/transcription-config';
import { FindPeerByNameRequestParams } from './signal/interfaces';
import { HMSSessionFeedback } from './end-call-feedback';
import {
HLSConfig,
HLSTimedMetadata,
Expand Down Expand Up @@ -340,6 +341,12 @@ export interface IHMSActions<T extends HMSGenericTypes = { sessionStore: Record<
*/
endRoom: (lock: boolean, reason: string) => Promise<void>;

/**
* After leave send feedback to backend for call quality purpose.
* @param feedback
*/
submitSessionFeedback(feedback: HMSSessionFeedback, eventEndpoint?: string): Promise<void>;

/**
* If you have **removeOthers** permission, you can remove a peer from the room.
* @param peerID peerID of the peer to be removed from the room
Expand Down
13 changes: 12 additions & 1 deletion packages/hms-video-store/src/analytics/AnalyticsEventFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,22 @@ export default class AnalyticsEventFactory {
});
}

static interruption(started: boolean, type: string, deviceInfo: Partial<MediaDeviceInfo>) {
static interruption({
started,
type,
reason,
deviceInfo,
}: {
started: boolean;
type: string;
reason: string;
deviceInfo: Partial<MediaDeviceInfo>;
}) {
return new AnalyticsEvent({
name: `${started ? 'interruption.start' : 'interruption.stop'}`,
level: AnalyticsEventLevel.INFO,
properties: {
reason,
type,
...deviceInfo,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ErrorFactory } from '../error/ErrorFactory';
import { HMSAction } from '../error/HMSAction';
import { EventBus } from '../events/EventBus';
import { HMSDeviceChangeEvent, HMSTrackUpdate, HMSUpdateListener } from '../interfaces';
import { isMobile } from '../internal';
import { HMSRemoteAudioTrack } from '../media/tracks';
import { HMSRemotePeer } from '../sdk/models/peer';
import { Store } from '../sdk/store';
Expand Down Expand Up @@ -40,17 +39,13 @@ export class AudioSinkManager {
private volume = 100;
private state = { ...INITIAL_STATE };
private listener?: HMSUpdateListener;
private timer: ReturnType<typeof setInterval> | null = null;
private autoUnpauseTimer: ReturnType<typeof setInterval> | null = null;
private earpieceSelected = false;

constructor(private store: Store, private deviceManager: DeviceManager, private eventBus: EventBus) {
this.eventBus.audioTrackAdded.subscribe(this.handleTrackAdd);
this.eventBus.audioTrackRemoved.subscribe(this.handleTrackRemove);
this.eventBus.audioTrackUpdate.subscribe(this.handleTrackUpdate);
this.eventBus.deviceChange.subscribe(this.handleAudioDeviceChange);
this.startPollingForDevices();
this.startPollingToCheckPausedAudio();
this.eventBus.localVideoUnmutedNatively.subscribe(this.unpauseAudioTracks);
}

setListener(listener?: HMSUpdateListener) {
Expand Down Expand Up @@ -97,20 +92,12 @@ export class AudioSinkManager {

cleanup() {
this.audioSink?.remove();
this.earpieceSelected = false;
this.audioSink = undefined;
if (this.timer) {
clearInterval(this.timer);
this.timer = null;
}
if (this.autoUnpauseTimer) {
clearInterval(this.autoUnpauseTimer);
this.autoUnpauseTimer = null;
}
this.eventBus.audioTrackAdded.unsubscribe(this.handleTrackAdd);
this.eventBus.audioTrackRemoved.unsubscribe(this.handleTrackRemove);
this.eventBus.audioTrackUpdate.unsubscribe(this.handleTrackUpdate);
this.eventBus.deviceChange.unsubscribe(this.handleAudioDeviceChange);
this.eventBus.localVideoUnmutedNatively.unsubscribe(this.unpauseAudioTracks);
this.autoPausedTracks = new Set();
this.state = { ...INITIAL_STATE };
}
Expand Down Expand Up @@ -190,11 +177,6 @@ export class AudioSinkManager {
};

private handleAudioDeviceChange = (event: HMSDeviceChangeEvent) => {
// this means the initial load
if (!event.selection) {
HMSLogger.d(this.TAG, 'device change called');
this.autoSelectAudioOutput();
}
// if there is no selection that means this is an init request. No need to do anything
if (event.isUserSelection || event.error || !event.selection || event.type === 'video') {
return;
Expand Down Expand Up @@ -265,58 +247,4 @@ export class AudioSinkManager {
track.setAudioElement(null);
}
};

private startPollingToCheckPausedAudio = () => {
if (isMobile()) {
this.autoUnpauseTimer = setInterval(() => {
this.unpauseAudioTracks();
}, 5000);
}
};

private startPollingForDevices = () => {
// device change supported, no polling needed
if ('ondevicechange' in navigator.mediaDevices) {
return;
}
this.timer = setInterval(() => {
(async () => {
await this.deviceManager.init(true, false);
await this.autoSelectAudioOutput();
this.unpauseAudioTracks();
})();
}, 5000);
};

/**
* Mweb is not able to play via call channel by default, this is to switch from media channel to call channel
*/
// eslint-disable-next-line complexity
private autoSelectAudioOutput = async () => {
if ('ondevicechange' in navigator.mediaDevices) {
return;
}
const { bluetoothDevice, earpiece, speakerPhone, wired } = this.deviceManager.categorizeAudioInputDevices();
const localAudioTrack = this.store.getLocalPeer()?.audioTrack;
if (localAudioTrack && earpiece) {
const manualSelection = this.deviceManager.getManuallySelectedAudioDevice();
const externalDeviceID =
manualSelection?.deviceId || bluetoothDevice?.deviceId || wired?.deviceId || speakerPhone?.deviceId;
HMSLogger.d(this.TAG, 'externalDeviceID', externalDeviceID);
// already selected appropriate device
if (localAudioTrack.settings.deviceId === externalDeviceID && this.earpieceSelected) {
return;
}
if (!this.earpieceSelected && bluetoothDevice?.deviceId !== externalDeviceID) {
await localAudioTrack.setSettings({ deviceId: earpiece?.deviceId }, true);
this.earpieceSelected = true;
}
await localAudioTrack.setSettings(
{
deviceId: externalDeviceID,
},
true,
);
}
};
}
Loading

0 comments on commit b1bdfdb

Please sign in to comment.