Update images.md (#26684)
parent
a2ae14b6a8
commit
74ffd55583
|
@ -73,8 +73,11 @@ The example in this section streams image source data using [JavaScript (JS) int
|
|||
const arrayBuffer = await imageStream.arrayBuffer();
|
||||
const blob = new Blob([arrayBuffer]);
|
||||
const url = URL.createObjectURL(blob);
|
||||
document.getElementById(imageElementId).src = url;
|
||||
URL.revokeObjectURL(url);
|
||||
const image = document.getElementById(imageElementId);
|
||||
image.onload = () => {
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
image.src = url;
|
||||
}
|
||||
</script>
|
||||
```
|
||||
|
@ -175,8 +178,11 @@ The example in this section streams image source data using [JavaScript (JS) int
|
|||
const arrayBuffer = await imageStream.arrayBuffer();
|
||||
const blob = new Blob([arrayBuffer]);
|
||||
const url = URL.createObjectURL(blob);
|
||||
document.getElementById(imageElementId).src = url;
|
||||
URL.revokeObjectURL(url);
|
||||
const image = document.getElementById(imageElementId);
|
||||
image.onload = () => {
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
image.src = url;
|
||||
}
|
||||
</script>
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue