canvasframework 0.5.12 → 0.5.13

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.
@@ -1932,16 +1932,37 @@ class CanvasFramework {
1932
1932
  // ✅ OPTIONNEL : Marquer les composants comme "dirty" pour forcer le rendu
1933
1933
  this._maxScrollDirty = true;
1934
1934
 
1935
- this.components.forEach(comp => {
1935
+ // ARRÊTER LES CAMÉRAS DES ANCIENS COMPOSANTS
1936
+ oldComponents.forEach(comp => {
1936
1937
  // Vérifier si c'est un composant caméra
1937
- if (comp.constructor.name === 'FloatedCamera' || comp.constructor.name === 'Camera') {
1938
+ if (comp.constructor.name === 'FloatedCamera' ||
1939
+ comp.constructor.name === 'Camera' ||
1940
+ comp.constructor.name === 'QRCodeReader') {
1938
1941
  // Arrêter le stream vidéo
1939
1942
  if (comp.stopCamera && typeof comp.stopCamera === 'function') {
1940
1943
  comp.stopCamera();
1941
- console.log(`🎥 Caméra ${comp.constructor.name} arrêtée avant navigation`);
1942
1944
  }
1943
1945
  }
1944
1946
  });
1947
+
1948
+ // ✅ NOUVEAU : Vérifier si la nouvelle route contient des composants caméra
1949
+ const hasCamera = this.components.some(comp =>
1950
+ comp.constructor.name === 'FloatedCamera' ||
1951
+ comp.constructor.name === 'Camera' ||
1952
+ comp.constructor.name === 'QRCodeReader'
1953
+ );
1954
+
1955
+ // Si la nouvelle route N'A PAS de caméra, nettoyer toutes les vidéos après 3 secondes
1956
+ if (!hasCamera) {
1957
+ console.log('⏰ Nettoyage des vidéos programmé dans 3 secondes...');
1958
+ setTimeout(() => {
1959
+ const videos = document.querySelectorAll('video');
1960
+ videos.forEach(v => v.remove());
1961
+ }, 3000);
1962
+ } else {
1963
+ console.log('📹 Route avec caméra détectée, pas de nettoyage automatique');
1964
+ }
1965
+
1945
1966
  }
1946
1967
 
1947
1968
  /**
package/index.js CHANGED
@@ -116,4 +116,4 @@ export { default as FeatureFlags } from './manager/FeatureFlags.js';
116
116
 
117
117
  // Version du framework
118
118
 
119
- export const VERSION = '0.5.7';
119
+ export const VERSION = '0.5.13';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "canvasframework",
3
- "version": "0.5.12",
3
+ "version": "0.5.13",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/beyons/CanvasFramework.git"