@@ -1565,6 +1565,7 @@ export default class LocalParticipant extends Participant {
15651565 destinationIdentities : options ?. destinationIdentities ,
15661566 topic : options ?. topic ,
15671567 attachedStreamIds : fileIds ,
1568+ attributes : options ?. attributes ,
15681569 } ) ;
15691570
15701571 await writer . write ( text ) ;
@@ -1602,13 +1603,15 @@ export default class LocalParticipant extends Participant {
16021603 timestamp : Date . now ( ) ,
16031604 topic : options ?. topic ?? '' ,
16041605 size : options ?. totalSize ,
1606+ attributes : options ?. attributes ,
16051607 } ;
16061608 const header = new DataStream_Header ( {
16071609 streamId,
16081610 mimeType : info . mimeType ,
16091611 topic : info . topic ,
16101612 timestamp : numberToBigInt ( info . timestamp ) ,
16111613 totalLength : numberToBigInt ( options ?. totalSize ) ,
1614+ attributes : info . attributes ,
16121615 contentHeader : {
16131616 case : 'textHeader' ,
16141617 value : new DataStream_TextHeader ( {
@@ -1722,8 +1725,14 @@ export default class LocalParticipant extends Participant {
17221725 topic : options ?. topic ,
17231726 destinationIdentities : options ?. destinationIdentities ,
17241727 } ) ;
1725-
1726- await writer . write ( new Uint8Array ( await file . arrayBuffer ( ) ) ) ;
1728+ const reader = file . stream ( ) . getReader ( ) ;
1729+ while ( true ) {
1730+ const { done, value } = await reader . read ( ) ;
1731+ if ( done ) {
1732+ break ;
1733+ }
1734+ await writer . write ( value ) ;
1735+ }
17271736 await writer . close ( ) ;
17281737 return writer . info ;
17291738 }
0 commit comments