@@ -1241,7 +1241,7 @@ describe("Media Source Extensions Playback Strategy", () => {
1241
1241
expect ( Plugins . interface . onErrorHandled ) . not . toHaveBeenCalledWith ( )
1242
1242
} )
1243
1243
1244
- it ( "should not publish error event on initial segment download error" , ( ) => {
1244
+ it ( "should not publish error event on init segment download error if more than one CDN available " , ( ) => {
1245
1245
const mockEvent = {
1246
1246
error : {
1247
1247
message : "initial segment download error" ,
@@ -1261,7 +1261,31 @@ describe("Media Source Extensions Playback Strategy", () => {
1261
1261
expect ( mockErrorCallback ) . not . toHaveBeenCalled ( )
1262
1262
} )
1263
1263
1264
- it ( "should not publish error event on content download error" , ( ) => {
1264
+ it ( "should publish error event on init segment download error if only one CDN available" , ( ) => {
1265
+ const mockEvent = {
1266
+ error : {
1267
+ message : "initial segment download error" ,
1268
+ code : 28 ,
1269
+ } ,
1270
+ }
1271
+
1272
+ setUpMSE ( )
1273
+
1274
+ const mockErrorCallback = jest . fn ( )
1275
+ mseStrategy . addErrorCallback ( null , mockErrorCallback )
1276
+
1277
+ mseStrategy . load ( null , 0 )
1278
+
1279
+ const noop = ( ) => { }
1280
+ mediaSources . failover ( noop , noop , { isBufferingTimeoutError : true } )
1281
+ mediaSources . failover ( noop , noop , { isBufferingTimeoutError : true } )
1282
+
1283
+ dashEventCallback ( dashjsMediaPlayerEvents . ERROR , mockEvent )
1284
+
1285
+ expect ( mockErrorCallback ) . toHaveBeenCalled ( )
1286
+ } )
1287
+
1288
+ it ( "should not publish error event on content download error if more than one CDN available" , ( ) => {
1265
1289
const mockEvent = {
1266
1290
error : {
1267
1291
message : "content download error" ,
@@ -1281,6 +1305,30 @@ describe("Media Source Extensions Playback Strategy", () => {
1281
1305
expect ( mockErrorCallback ) . not . toHaveBeenCalled ( )
1282
1306
} )
1283
1307
1308
+ it ( "should publish error event on content download error if only one CDN available" , ( ) => {
1309
+ const mockEvent = {
1310
+ error : {
1311
+ message : "content download error" ,
1312
+ code : 27 ,
1313
+ } ,
1314
+ }
1315
+
1316
+ setUpMSE ( )
1317
+
1318
+ const mockErrorCallback = jest . fn ( )
1319
+ mseStrategy . addErrorCallback ( null , mockErrorCallback )
1320
+
1321
+ mseStrategy . load ( null , 0 )
1322
+
1323
+ const noop = ( ) => { }
1324
+ mediaSources . failover ( noop , noop , { isBufferingTimeoutError : true } )
1325
+ mediaSources . failover ( noop , noop , { isBufferingTimeoutError : true } )
1326
+
1327
+ dashEventCallback ( dashjsMediaPlayerEvents . ERROR , mockEvent )
1328
+
1329
+ expect ( mockErrorCallback ) . toHaveBeenCalled ( )
1330
+ } )
1331
+
1284
1332
it ( "should initiate a failover with correct parameters on manifest download error" , ( ) => {
1285
1333
const mockEvent = {
1286
1334
error : {
0 commit comments