Now manage to replace the Foundry native AV dock
CI / ci (push) Failing after 16s

This commit is contained in:
2026-05-24 09:39:53 +02:00
parent c4a375f4e3
commit 6d7a0b5fd7
94 changed files with 6027 additions and 20 deletions
+23 -11
View File
@@ -179,22 +179,34 @@ Hooks.once("ready", () => {
// Probe WebRTC capability and set adapter.webrtc
// For FULL REPLACEMENT: we need stream access to create our own video tiles
const outcome = FoundryAdapter.probeCapability(game.webrtc);
adapter.settings.set(FoundryAdapter.SETTING_WEBRTC_MODE, outcome).catch(err => {
// Migration: if webrtcMode is an old deprecated value, probe fresh capability
// This ensures existing installations get the new stream-access mode if available
const currentWebRtcMode = adapter.settings.get(FoundryAdapter.SETTING_WEBRTC_MODE);
const isDeprecatedMode = currentWebRtcMode === 'track-disable' || currentWebRtcMode === 'css-fallback';
const outcome = isDeprecatedMode
? FoundryAdapter.probeCapability(game.webrtc)
: currentWebRtcMode || FoundryAdapter.probeCapability(game.webrtc);
adapter.settings?.set(FoundryAdapter.SETTING_WEBRTC_MODE, outcome).catch(err => {
console.error('[ScryingPool] Failed to set webrtcMode setting:', err);
});
// Build WebRTC surface for stream access (full replacement mode)
if (outcome === 'stream-access') {
adapter.webrtc = FoundryAdapter.buildWebRTCSurface(game.webrtc);
console.log('[ScryingPool] WebRTC stream access available - full replacement mode enabled');
} else if (outcome === 'unsupported') {
try {
if (outcome === 'stream-access') {
adapter.webrtc = FoundryAdapter.buildWebRTCSurface(game.webrtc);
console.log('[ScryingPool] WebRTC stream access available - full replacement mode enabled');
} else if (outcome === 'unsupported') {
adapter.webrtc = null;
console.log('[ScryingPool] WebRTC not available - AV features disabled');
} else {
// Legacy: track-disable or css-fallback (deprecated)
adapter.webrtc = FoundryAdapter.buildWebRTCSurface(game.webrtc);
console.warn('[ScryingPool] WebRTC mode is deprecated:', outcome, '- consider using stream-access');
}
} catch (err) {
console.error('[ScryingPool] Failed to build WebRTC surface:', err);
adapter.webrtc = null;
console.log('[ScryingPool] WebRTC not available - AV features disabled');
} else {
// Legacy: track-disable or css-fallback (deprecated)
adapter.webrtc = FoundryAdapter.buildWebRTCSurface(game.webrtc);
console.warn('[ScryingPool] WebRTC mode is deprecated:', outcome, '- consider using stream-access');
}
// Wire core managers — construct both before setReady so handler can reference both