Skip to content

Commit 7507667

Browse files
committed
advanced-features: azure-advanced-recording-tutorial - changed all s3 references
1 parent b1aeb2f commit 7507667

File tree

3 files changed

+11
-18
lines changed

3 files changed

+11
-18
lines changed

advanced-features/openvidu-recording-advanced-node-azure/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LIVEKIT_API_SECRET=secret
77

88
# Recording configuration
99
RECORDINGS_PATH=recordings/
10-
RECORDING_PLAYBACK_STRATEGY=S3
10+
RECORDING_PLAYBACK_STRATEGY=AZURE
1111

1212
# Azure Blob Storage configuration
1313
AZURE_ACCOUNT_NAME=yourstorageaccountname

advanced-features/openvidu-recording-advanced-node-azure/src/config.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ export const LIVEKIT_URL = process.env.LIVEKIT_URL || "http://localhost:7880";
66
export const LIVEKIT_API_KEY = process.env.LIVEKIT_API_KEY || "devkey";
77
export const LIVEKIT_API_SECRET = process.env.LIVEKIT_API_SECRET || "secret";
88

9-
// S3 configuration
10-
export const S3_ENDPOINT = process.env.S3_ENDPOINT || "http://localhost:9000";
11-
export const S3_ACCESS_KEY = process.env.S3_ACCESS_KEY || "minioadmin";
12-
export const S3_SECRET_KEY = process.env.S3_SECRET_KEY || "minioadmin";
13-
export const AWS_REGION = process.env.AWS_REGION || "us-east-1";
14-
export const S3_BUCKET = process.env.S3_BUCKET || "openvidu";
15-
169
// Azure Blob Storage configuration
1710
export const AZURE_ACCOUNT_NAME = process.env.AZURE_ACCOUNT_NAME || "your_account_name";
1811
export const AZURE_ACCOUNT_KEY = process.env.AZURE_ACCOUNT_KEY || "your_account_key";
@@ -21,5 +14,5 @@ export const AZURE_ENDPOINT = process.env.AZURE_ENDPOINT || `https://${AZURE_ACC
2114

2215
export const RECORDINGS_PATH = process.env.RECORDINGS_PATH ?? "recordings/";
2316
export const RECORDINGS_METADATA_PATH = ".metadata/";
24-
export const RECORDING_PLAYBACK_STRATEGY = process.env.RECORDING_PLAYBACK_STRATEGY || "S3"; // PROXY or S3
17+
export const RECORDING_PLAYBACK_STRATEGY = process.env.RECORDING_PLAYBACK_STRATEGY || "AZURE"; // PROXY or S3
2518
export const RECORDING_FILE_PORTION_SIZE = 5 * 1024 * 1024; // 5MB

advanced-features/openvidu-recording-advanced-node-azure/src/services/azure.blobstorage.service.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,32 +44,32 @@ export class AzureBlobService {
4444
return AzureBlobService.instance;
4545
}
4646

47-
// Sube un objeto (JSON) al contenedor
47+
// Uploads an object (JSON) to the container
4848
async uploadObject(key, body) {
4949
const blockBlobClient = this.containerClient.getBlockBlobClient(key);
5050
const data = JSON.stringify(body);
5151
await blockBlobClient.upload(data, Buffer.byteLength(data));
5252
}
5353

54-
// Comprueba si existe un blob
54+
// Checks if a blob exists
5555
async exists(key) {
5656
const blobClient = this.containerClient.getBlobClient(key);
5757
return await blobClient.exists();
5858
}
5959

60-
// Obtiene las propiedades del blob (equivalente a headObject)
60+
// Gets the blob properties (equivalent to headObject)
6161
async headObject(key) {
6262
const blobClient = this.containerClient.getBlobClient(key);
6363
return await blobClient.getProperties();
6464
}
6565

66-
// Devuelve el tamaño del blob en bytes
66+
// Returns the blob size in bytes
6767
async getObjectSize(key) {
6868
const props = await this.headObject(key);
6969
return props.contentLength || 0;
7070
}
7171

72-
// Descarga el blob completo o un rango, devolviendo el stream
72+
// Downloads the complete blob or a range, returning the stream
7373
async getObject(key, range) {
7474
const blobClient = this.containerClient.getBlobClient(key);
7575
let downloadResponse;
@@ -86,7 +86,7 @@ export class AzureBlobService {
8686
return downloadResponse.readableStreamBody;
8787
}
8888

89-
// Genera un URL SAS válido 24 horas
89+
// Generates a valid SAS URL for 24 hours
9090
async getObjectUrl(key) {
9191
if (!AZURE_ACCOUNT_NAME || !AZURE_ACCOUNT_KEY) {
9292
throw new Error("Credenciales de cuenta de Azure no están definidas para generar SAS");
@@ -108,7 +108,7 @@ export class AzureBlobService {
108108
return `${blobClient.url}?${sasToken}`;
109109
}
110110

111-
// Obtiene el contenido JSON del blob
111+
// Gets the JSON content of the blob
112112
async getObjectAsJson(key) {
113113
const exists = await this.exists(key);
114114
if (!exists) {
@@ -128,7 +128,7 @@ export class AzureBlobService {
128128
});
129129
}
130130

131-
// Lista blobs bajo un prefijo y filtra por expresión regular
131+
// Lists blobs under a prefix and filters by regular expression
132132
async listObjects(prefix, regex) {
133133
const results = [];
134134
for await (const blob of this.containerClient.listBlobsFlat({ prefix })) {
@@ -139,7 +139,7 @@ export class AzureBlobService {
139139
return results;
140140
}
141141

142-
// Elimina un blob
142+
// Deletes a blob
143143
async deleteObject(key) {
144144
const blobClient = this.containerClient.getBlobClient(key);
145145
await blobClient.delete();

0 commit comments

Comments
 (0)