Skip to content

NetworkTypeObserver doesn't update it's initial value after creation #10970

Closed
@rychagovDi

Description

@rychagovDi

ExoPlayer Version

2.18.2

Devices that reproduce the issue

Pixel 6 running Android 13

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

No

Reproduction steps

Can't find a real auto-quality dash-vp9 video in demo app - it always asks to choose quality before playback start.

The issue is in adaptive quality selection - due to initially low bandwidth, player choose low quality at the start of playback.

Expected result

Video starts with good quality, accordingly to actual network bandwidth.

Actual result

Video starts with bad quality, because of low initial bandwidth

I investigated the issue, and it seems like NetworkTypeObserver#Receiver#onReceive method doesn't get called after registering broadcast receiver (even later, 'asynchronously').

Seems like NetworkTypeObservers' internal impl expects sticky behavior from BroadcastReceiver (so it would receive last network type after receiver registering) - but actually it doesn't work this way.

Moreover, https://developer.android.com/reference/android/net/ConnectivityManager#CONNECTIVITY_ACTION is deprecated and Google advices to use NetworkCallback or/and direct call to ConnectivityManager#requestBandwidthUpdate() to force-receive current network state and it's bandwidth.

Media

Not applicable

Bug Report

  • You will email the zip file produced by adb bugreport to [email protected] after filing this issue.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions