@@ -739,7 +739,6 @@ var Conference = function (rpcClient, selfRpcId) {
739
739
740
740
const isAudioPubPermitted = ! ! participants [ info . owner ] . isPublishPermitted ( 'audio' ) ;
741
741
const subArgs = subscription . toRoomCtrlSubArgs ( ) ;
742
- const subInfo = { transport : transport , media : media , data : dataSpec } ;
743
742
const subs = subArgs . map ( subArg => new Promise ( ( resolve , reject ) => {
744
743
if ( roomController ) {
745
744
const subInfo = { transport : transport , media : subArg . media , data : subArg . data } ;
@@ -948,7 +947,8 @@ var Conference = function (rpcClient, selfRpcId) {
948
947
}
949
948
const rtcPubInfo = {
950
949
type : pubInfo . type ,
951
- transportId : pubInfo . transportId ,
950
+ transport : pubInfo . transport ,
951
+ transportId : pubInfo . transport . id ,
952
952
tracks : pubInfo . media . tracks ,
953
953
legacy : pubInfo . legacy ,
954
954
data : pubInfo . data
@@ -962,8 +962,10 @@ var Conference = function (rpcClient, selfRpcId) {
962
962
}
963
963
const rtcSubInfo = {
964
964
type : subDesc . type ,
965
- transportId : subDesc . transportId ,
965
+ transport : subDesc . transport ,
966
+ transportId : subDesc . transport . id ,
966
967
tracks : subDesc . media . tracks ,
968
+ data : subDesc . data ,
967
969
legacy : subDesc . legacy ,
968
970
} ;
969
971
return rtcSubInfo ;
@@ -1272,30 +1274,32 @@ var Conference = function (rpcClient, selfRpcId) {
1272
1274
} ) ;
1273
1275
} else {
1274
1276
var format_preference ;
1275
- if ( subDesc . type === 'webrtc' ) {
1277
+ if ( subDesc . type === 'webrtc' || subDesc . type === 'quic' ) {
1276
1278
const rtcSubInfo = translateRtcSubIfNeeded ( subDesc ) ;
1277
- // Set formatPreference
1278
- rtcSubInfo . tracks . forEach ( track => {
1279
- const streamId = streams [ track . from ] ? track . from : trackOwners [ track . from ] ;
1280
- const source = getStreamTrack ( track . from , track . type ) ;
1281
- const formatPreference = { } ;
1282
- if ( streams [ streamId ] . type === 'forward' ) {
1283
- formatPreference . preferred = source . format ;
1284
- source . optional && source . optional . format && ( formatPreference . optional = source . optional . format ) ;
1285
- } else {
1286
- formatPreference . optional = [ source . format ] ;
1287
- source . optional && source . optional . format && ( formatPreference . optional = formatPreference . optional . concat ( source . optional . format ) ) ;
1288
- }
1289
- track . formatPreference = formatPreference ;
1290
- } ) ;
1279
+ if ( rtcSubInfo . tracks ) {
1280
+ // Set formatPreference
1281
+ rtcSubInfo . tracks . forEach ( track => {
1282
+ const streamId = streams [ track . from ] ? track . from : trackOwners [ track . from ] ;
1283
+ const source = getStreamTrack ( track . from , track . type ) ;
1284
+ const formatPreference = { } ;
1285
+ if ( streams [ streamId ] . type === 'forward' ) {
1286
+ formatPreference . preferred = source . format ;
1287
+ source . optional && source . optional . format && ( formatPreference . optional = source . optional . format ) ;
1288
+ } else {
1289
+ formatPreference . optional = [ source . format ] ;
1290
+ source . optional && source . optional . format && ( formatPreference . optional = formatPreference . optional . concat ( source . optional . format ) ) ;
1291
+ }
1292
+ track . formatPreference = formatPreference ;
1293
+ } ) ;
1294
+ }
1291
1295
1292
1296
initiateSubscription ( subscriptionId , subDesc , { owner : participantId , type : subDesc . type } ) ;
1293
1297
return rtcController . initiate ( participantId , subscriptionId , 'out' , participants [ participantId ] . getOrigin ( ) , rtcSubInfo )
1294
1298
. then ( ( result ) => {
1295
- const releasedSource = rtcSubInfo . tracks . find ( track => {
1296
- const sourceStreamId = trackOwners [ track . from ] || track . from ;
1297
- return ! streams [ sourceStreamId ] ;
1298
- } ) ;
1299
+ const releasedSource = rtcSubInfo . tracks ? rtcSubInfo . tracks . find ( track => {
1300
+ const sourceStreamId = trackOwners [ track . from ] || track . from ;
1301
+ return ! streams [ sourceStreamId ] ;
1302
+ } ) : undefined ;
1299
1303
if ( releasedSource ) {
1300
1304
rtcController . terminate ( participantId , subscriptionId , 'Participant terminate' ) ;
1301
1305
return Promise . reject ( 'Target audio/video stream early released' ) ;
@@ -1671,11 +1675,11 @@ var Conference = function (rpcClient, selfRpcId) {
1671
1675
1672
1676
return removeSubscription ( subscriptionId )
1673
1677
. then ( ( result ) => {
1674
- return addSubscription ( subscriptionId , oldSub . locality , newSubMedia , oldSub . info ) ;
1678
+ return addSubscription ( subscriptionId , oldSub . locality , newSubMedia , oldSub . data , oldSub . info ) ;
1675
1679
} ) . catch ( ( err ) => {
1676
1680
log . info ( 'Update subscription failed:' , err . message ? err . message : err ) ;
1677
1681
log . info ( 'And is recovering the previous subscription:' , JSON . stringify ( old_su ) ) ;
1678
- return addSubscription ( subscriptionId , oldSub . locality , oldSub . media , oldSub . info )
1682
+ return addSubscription ( subscriptionId , oldSub . locality , oldSub . media , oldSub . data , oldSub . info )
1679
1683
. then ( ( ) => {
1680
1684
return Promise . reject ( 'Update subscription failed' ) ;
1681
1685
} , ( ) => {
0 commit comments