aotrautils 0.0.509 → 0.0.511

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.
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- /*utils COMMONS library associated with aotra version : «1_29072022-2359 (05/02/2023-20:38:00)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (15/02/2023-02:35:55)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -4866,7 +4866,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
4866
4866
 
4867
4867
 
4868
4868
 
4869
- /*utils CLIENT library associated with aotra version : «1_29072022-2359 (05/02/2023-20:38:00)»*/
4869
+ /*utils CLIENT library associated with aotra version : «1_29072022-2359 (15/02/2023-02:35:55)»*/
4870
4870
  /*-----------------------------------------------------------------------------*/
4871
4871
  /* ## Utility global methods in a browser (htmljs) client environment.
4872
4872
  *
@@ -6652,8 +6652,49 @@ base64StringToIntArray=function(dataURI){
6652
6652
  }
6653
6653
  // return new Uint8Array(array);
6654
6654
  return array;
6655
+ };
6656
+
6657
+ // DOES NOT SEEM TO WORK (for images src for instance)
6658
+ intArrayToBase64String=function(intArray, addAlphaCharacter=false){
6659
+ let result="";
6660
+ if(!intArray || !isArray(intArray)){
6661
+ // TRACE
6662
+ lognow("ERROR : Int array is not an array. Aborting. Array parameter :",intArray);
6663
+ return result;
6664
+ }
6665
+ foreach(intArray,(i, index)=>{
6666
+ result+=String.fromCharCode(i);
6667
+ if(addAlphaCharacter && (index%3)==0)
6668
+ result+=String.fromCharCode(255);
6669
+ });
6670
+ result=btoa(result);
6671
+ return result;
6672
+ };
6673
+
6674
+ // UNUSED :
6675
+ //intArrayToBlob=function(intArray, type="image/bmp" /*other values : "image/jpeg", "image/png"*/){
6676
+ // if(!intArray || !isArray(intArray)){
6677
+ // // TRACE
6678
+ // lognow("ERROR : Int array is not an array. Aborting. Array parameter :",intArray);
6679
+ // return URL.createObjectURL(new Blob());
6680
+ // }
6681
+ //
6682
+ //// let str="";
6683
+ //// foreach(intArray,(i)=>{
6684
+ //// str+=String.fromCharCode(i);
6685
+ //// });
6686
+ //// let blob=new Blob([str], {type: type});
6687
+ //
6688
+ // let arr=new Uint8Array(intArray);
6689
+ // let blob=new Blob([arr.buffer], {type: type});
6690
+ //
6691
+ // const result = URL.createObjectURL(blob);
6692
+ // return result;
6693
+ //};
6694
+
6695
+
6696
+
6655
6697
 
6656
- }
6657
6698
 
6658
6699
 
6659
6700
  function addAlphaCanalIfNecessary(videoRawData, /*OPTIONAL*/isMessWithAlpha=false){
@@ -9413,7 +9454,6 @@ arrayToString=function(arr,compressResult=true,precisionFraction=null,isSigned=f
9413
9454
  // if(compressResult) str=LZWString.compress(str);
9414
9455
 
9415
9456
  return str;
9416
-
9417
9457
  }
9418
9458
 
9419
9459
  // if signed :
@@ -11797,6 +11837,42 @@ createFusrodaClient=function(doOnClientReady, doOnDataReception, urlParam=null,
11797
11837
 
11798
11838
 
11799
11839
 
11840
+
11841
+ // =======================================================================
11842
+ // ========================== orita CONSTANTS ==========================
11843
+ // =======================================================================
11844
+
11845
+
11846
+
11847
+ //Global constants :
11848
+
11849
+
11850
+ const ORITA_CONSTANTS={
11851
+
11852
+ DEFAULT_PROTOCOL:"http",
11853
+ DEFAULT_PORT:25000,
11854
+
11855
+ STRINGIFY_VIDEO_DATA:false,
11856
+
11857
+
11858
+ MOBILE_VIDEO_CONSTRAINTS: {},
11859
+ //OLD : CHANNELS_CONFIG:{video:2,audio:1},
11860
+ // let CHANNELS_CONFIG:null,
11861
+ IS_MOBILE:null,
11862
+
11863
+
11864
+ AUDIO_BUFFER_SIZE:16384,
11865
+
11866
+ DEFAULT_CAPTURE_WIDTH:64,
11867
+ DEFAULT_CAPTURE_HEIGHT:64,
11868
+
11869
+
11870
+ };
11871
+
11872
+
11873
+
11874
+
11875
+
11800
11876
  // ------------------------------------------------------------------------------------------
11801
11877
  // -------------------------------------- MAIN CLIENT --------------------------------------
11802
11878
  // ------------------------------------------------------------------------------------------
@@ -12162,6 +12238,9 @@ createOritaMainClient=function(
12162
12238
 
12163
12239
  createOritaMicroClient=function(url, port, isNode=false, staticMicroClientIdParam=null){
12164
12240
 
12241
+
12242
+ let audioBufferSize = ORITA_CONSTANTS.AUDIO_BUFFER_SIZE;
12243
+
12165
12244
 
12166
12245
  const staticMicroClientId=(!isNode?nonull(staticMicroClientIdParam,getURLParameter("mid")):null);
12167
12246
 
@@ -12999,7 +13078,7 @@ createOritaMicroClient=function(url, port, isNode=false, staticMicroClientIdPara
12999
13078
  };
13000
13079
 
13001
13080
 
13002
- /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (05/02/2023-20:38:00)»*/
13081
+ /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (15/02/2023-02:35:55)»*/
13003
13082
  /*-----------------------------------------------------------------------------*/
13004
13083
 
13005
13084
 
@@ -14227,7 +14306,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
14227
14306
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
14228
14307
 
14229
14308
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
14230
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (05/02/2023-20:38:00)»*/
14309
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (15/02/2023-02:35:55)»*/
14231
14310
  /*-----------------------------------------------------------------------------*/
14232
14311
 
14233
14312
 
@@ -15181,8 +15260,7 @@ WebsocketImplementation={
15181
15260
  if(listenerConfig && listenerConfig.destroyListenerAfterReceiving)
15182
15261
  remove(browserInstance.receptionEntryPoints,receptionEntryPoint);
15183
15262
 
15184
- // DBG
15185
- lognow("browserInstance.receptionEntryPoints("+browserInstance.receptionEntryPoints.length+"):",browserInstance.receptionEntryPoints);
15263
+
15186
15264
 
15187
15265
  }
15188
15266
  };
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.509",
3
+ "version": "0.0.511",
4
4
  "main": "aotrautils.build.js",
5
5
  "description": "A library for vanilla javascript utils (client-side) used in aotra javascript CMS",
6
6
  "author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",