Kosh
Kosh
CDCloudflare Developers
Created by Kosh on 2/20/2025 in #general-help
Stream API mismatch with CloudFlare Stream page
Hi folks any comments regards this? its rather urgent for us.
4 replies
CDCloudflare Developers
Created by Kosh on 2/20/2025 in #general-help
Stream API mismatch with CloudFlare Stream page
I even have this function:
async deleteAllVideos() {
const videos = await this.client.stream.list({
account_id: this.accoundId,
})

await Promise.all(
videos.result.map((video) =>
this.client.stream.delete(video.uid!, {
account_id: this.accoundId,
})
)
)

await new Promise((resolve) => setTimeout(resolve, 2000))
const verifyVideos = await this.client.stream.list({
account_id: this.accoundId,
})

if (verifyVideos.result.length > 0) {
throw new Error("Videos not fully deleted")
}
}
async deleteAllVideos() {
const videos = await this.client.stream.list({
account_id: this.accoundId,
})

await Promise.all(
videos.result.map((video) =>
this.client.stream.delete(video.uid!, {
account_id: this.accoundId,
})
)
)

await new Promise((resolve) => setTimeout(resolve, 2000))
const verifyVideos = await this.client.stream.list({
account_id: this.accoundId,
})

if (verifyVideos.result.length > 0) {
throw new Error("Videos not fully deleted")
}
}
Which guarentee that no videos are there and passes with flying flags.
4 replies