@daily-co/daily-js
Advanced tools
Comparing version 0.25.0 to 0.26.0
@@ -46,2 +46,3 @@ // Type definitions for daily-js | ||
| 'participant-left' | ||
| 'participant-counts-updated' | ||
| 'track-started' | ||
@@ -90,2 +91,3 @@ | 'track-stopped' | ||
| 'theme-updated' | ||
| 'available-devices-updated' | ||
| 'receive-settings-updated' | ||
@@ -210,3 +212,3 @@ | 'input-settings-updated' | ||
export interface DailyCustomTrayButtons { | ||
[id: string] : DailyCustomTrayButton | ||
[id: string]: DailyCustomTrayButton; | ||
} | ||
@@ -325,2 +327,7 @@ | ||
export interface DailyParticipantCounts { | ||
present: number; | ||
hidden: number; | ||
} | ||
export interface DailyWaitingParticipant { | ||
@@ -591,2 +598,7 @@ id: string; | ||
export interface DailyEventObjectParticipantCounts { | ||
action: Extract<DailyEvent, 'participant-counts-updated'>; | ||
participantCounts: DailyParticipantCounts; | ||
} | ||
export interface DailyEventObjectWaitingParticipant { | ||
@@ -718,2 +730,7 @@ action: Extract< | ||
export interface DailyEventObjectAvailableDevicesUpdated { | ||
action: Extract<DailyEvent, 'available-devices-updated'>; | ||
availableDevices: MediaDeviceInfo[]; | ||
} | ||
export interface DailyEventObjectShowLocalVideoChanged { | ||
@@ -772,2 +789,4 @@ action: Extract<DailyEvent, 'show-local-video-changed'>; | ||
? DailyEventObjectParticipant | ||
: T extends DailyEventObjectParticipantCounts['action'] | ||
? DailyEventObjectParticipantCounts | ||
: T extends DailyEventObjectWaitingParticipant['action'] | ||
@@ -807,2 +826,4 @@ ? DailyEventObjectWaitingParticipant | ||
? DailyEventObjectReceiveSettingsUpdated | ||
: T extends DailyEventObjectAvailableDevicesUpdated['action'] | ||
? DailyEventObjectAvailableDevicesUpdated | ||
: T extends DailyEventObjectShowLocalVideoChanged['action'] | ||
@@ -903,2 +924,3 @@ ? DailyEventObjectShowLocalVideoChanged | ||
height?: number; | ||
fps?: number; | ||
backgroundColor?: string; | ||
@@ -959,2 +981,3 @@ layout?: DailyStreamingLayoutConfig; | ||
participants(): DailyParticipantsObject; | ||
participantCounts(): DailyParticipantCounts; | ||
updateParticipant( | ||
@@ -994,5 +1017,3 @@ sessionId: string, | ||
getInputSettings(): Promise<DailyInputSettings>; | ||
updateCustomTrayButtons( | ||
customTrayButtons: DailyCustomTrayButtons | ||
): DailyCall; | ||
updateCustomTrayButtons(customTrayButtons: DailyCustomTrayButtons): DailyCall; | ||
customTrayButtons(): DailyCustomTrayButtons; | ||
@@ -999,0 +1020,0 @@ setBandwidth(bw: { |
{ | ||
"name": "@daily-co/daily-js", | ||
"version": "0.25.0", | ||
"version": "0.26.0", | ||
"engines": { | ||
@@ -5,0 +5,0 @@ "node": ">=10.0.0" |
@@ -62,2 +62,4 @@ // | ||
export const DAILY_EVENT_LEFT_MEETING = 'left-meeting'; | ||
export const DAILY_EVENT_AVAILABLE_DEVICES_UPDATED = | ||
'available-devices-updated'; | ||
@@ -68,2 +70,5 @@ export const DAILY_EVENT_PARTICIPANT_JOINED = 'participant-joined'; | ||
export const DAILY_EVENT_PARTICIPANT_COUNTS_UPDATED = | ||
'participant-counts-updated'; | ||
export const DAILY_EVENT_ACCESS_STATE_UPDATED = 'access-state-updated'; | ||
@@ -146,3 +151,4 @@ | ||
export const DAILY_METHOD_UPDATE_CUSTOM_TRAY_BUTTONS = 'update-custom-tray-buttons'; | ||
export const DAILY_METHOD_UPDATE_CUSTOM_TRAY_BUTTONS = | ||
'update-custom-tray-buttons'; | ||
export const DAILY_METHOD_SET_THEME = 'set-theme'; | ||
@@ -169,2 +175,3 @@ export const DAILY_METHOD_START_CAMERA = 'start-camera'; | ||
export const DAILY_METHOD_CYCLE_CAMERA = 'cycle-camera'; | ||
export const DAILY_METHOD_SET_CAMERA = 'set-camera'; | ||
export const DAILY_METHOD_CYCLE_MIC = 'cycle-mic'; | ||
@@ -171,0 +178,0 @@ export const DAILY_METHOD_GET_CAMERA_FACING_MODE = 'get-camera-facing-mode'; |
@@ -225,15 +225,2 @@ // This method should be used instead of window.navigator.userAgent, which | ||
export function getDailyJsVersion() { | ||
let major = 0, | ||
minor = 0, | ||
patch = 0; | ||
if (typeof _dailyConfig !== 'undefined' && _dailyConfig.dailyJsVersion) { | ||
const versionParts = _dailyConfig.dailyJsVersion.split('.'); | ||
major = parseInt(versionParts[0], 10); | ||
minor = parseInt(versionParts[1], 10); | ||
patch = parseInt(versionParts[2], 10); | ||
} | ||
return { major, minor, patch }; | ||
} | ||
function isDisplayMediaAccessible() { | ||
@@ -303,1 +290,70 @@ return !!( | ||
} | ||
//-------------------------------- | ||
// daily-js version helpers | ||
// Daily supports the last 6 months of versions. | ||
// These variable should be updated as part of each release as needed. | ||
// OLDEST should match the oldest version that is exactly 6 months or | ||
// less at the time of each release. | ||
const OLDEST_SUPPORTED_DAILY_JS_VERSION = { | ||
major: 0, | ||
minor: 20, | ||
patch: 0, | ||
}; | ||
// NEARING should be a version roughly 1 month out from being unsupported | ||
// to give customers ample time to upgrade. | ||
const NEARING_EOS_DAILY_JS_VERSION = { | ||
major: 0, | ||
minor: 21, | ||
patch: 0, | ||
}; | ||
export function getDailyJsVersion() { | ||
let major = 0, | ||
minor = 0, | ||
patch = 0; | ||
if (typeof _dailyConfig !== 'undefined' && _dailyConfig.dailyJsVersion) { | ||
const versionParts = _dailyConfig.dailyJsVersion.split('.'); | ||
major = parseInt(versionParts[0], 10); | ||
minor = parseInt(versionParts[1], 10); | ||
patch = parseInt(versionParts[2], 10); | ||
} | ||
return { major, minor, patch }; | ||
} | ||
export function isThisDailyJsVersionAtLeastThat(thisV, thatV) { | ||
if (thisV.major != thatV.major) { | ||
return thisV.major > thatV.major; | ||
} | ||
if (thisV.minor != thatV.minor) { | ||
return thisV.minor > thatV.minor; | ||
} | ||
return thisV.patch >= thatV.patch; | ||
} | ||
export function isThisDailyJsVersionNewerThanThat(thisV, thatV) { | ||
if (thisV.major != thatV.major) { | ||
return thisV.major > thatV.major; | ||
} | ||
if (thisV.minor != thatV.minor) { | ||
return thisV.minor > thatV.minor; | ||
} | ||
return thisV.patch > thatV.patch; | ||
} | ||
export function isCurrentDailyJsSupported() { | ||
return isThisDailyJsVersionAtLeastThat( | ||
getDailyJsVersion(), | ||
OLDEST_SUPPORTED_DAILY_JS_VERSION | ||
); | ||
} | ||
export function isCurrentDailyJsNearEndOfSupport() { | ||
return !isThisDailyJsVersionNewerThanThat( | ||
getDailyJsVersion(), | ||
NEARING_EOS_DAILY_JS_VERSION | ||
); | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
536677
39659
7053
2
26