diff --git a/libraries/common/src/main/java/androidx/media3/common/util/NetworkTypeObserver.java b/libraries/common/src/main/java/androidx/media3/common/util/NetworkTypeObserver.java index 7b64795466c..a8c8e0e2f3d 100644 --- a/libraries/common/src/main/java/androidx/media3/common/util/NetworkTypeObserver.java +++ b/libraries/common/src/main/java/androidx/media3/common/util/NetworkTypeObserver.java @@ -91,7 +91,7 @@ private NetworkTypeObserver(Context context) { mainHandler = new Handler(Looper.getMainLooper()); listeners = new CopyOnWriteArrayList<>(); networkTypeLock = new Object(); - networkType = C.NETWORK_TYPE_UNKNOWN; + networkType = getNetworkTypeFromConnectivityManager(context); IntentFilter filter = new IntentFilter(); filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); context.registerReceiver(new Receiver(), filter); diff --git a/libraries/exoplayer_dash/src/test/java/androidx/media3/exoplayer/dash/DefaultDashChunkSourceTest.java b/libraries/exoplayer_dash/src/test/java/androidx/media3/exoplayer/dash/DefaultDashChunkSourceTest.java index 720398d6f9b..7941e847af0 100644 --- a/libraries/exoplayer_dash/src/test/java/androidx/media3/exoplayer/dash/DefaultDashChunkSourceTest.java +++ b/libraries/exoplayer_dash/src/test/java/androidx/media3/exoplayer/dash/DefaultDashChunkSourceTest.java @@ -249,9 +249,9 @@ public FallbackSelection getFallbackSelectionFor( } assertThat(Lists.transform(chunks, (chunk) -> chunk.dataSpec.uri.toString())) .containsExactly( - "http://video.com/baseUrl/a/video/video_0_700000.m4s", "http://video.com/baseUrl/a/video/video_0_452000.m4s", "http://video.com/baseUrl/a/video/video_0_250000.m4s", + "http://video.com/baseUrl/a/video/video_0_700000.m4s", "http://video.com/baseUrl/a/video/video_0_1300000.m4s") .inOrder(); }