Skip to content

Support app specified ad markers in player UI #3184

Closed
@tonihuotari

Description

Issue description

I can't get visible ad markers after upgrading from 2.4.4. I've tried both 2.5.0 and 2.5.1

Reproduction steps

In exoplayer 2.4.4 you could add the following lines to get visible ad markers:

TimeBar timeBar = (TimeBar) findViewById(R.id.exo_progress); long[] adGroupTimesMs = {40000, 60000, 80000}; timeBar.setAdBreakTimesMs(adGroupTimesMs, 3);

In exoplayer 2.5.0 changes were made to how ad markers are set in the TimeBar. The following code should correspond to the working code in previous versions. However ad markers are not visible.

TimeBar timeBar = (TimeBar) findViewById(R.id.exo_progress); long[] adGroupTimesMs = {40000, 60000, 80000}; boolean[] playedAdGroups = {false, true, false}; timeBar.setAdGroupTimesMs(adGroupTimesMs, playedAdGroups, 3);

I've also tried adding specific colors and width without success:

<com.google.android.exoplayer2.ui.DefaultTimeBar android:id="@+id/exo_progress" android:layout_width="match_parent" android:layout_height="wrap_content" app:ad_marker_color="#00FF00" app:ad_marker_width="5dp" android:layout_toEndOf="@id/exo_position" android:layout_toStartOf="@id/exo_duration"/>

Link to test content

Use any stream provided in the Exoplayer demo

Version of ExoPlayer being used

Affected versions: 2.5.0, 2.5.1
Working version: 2.4.4

Device(s) and version(s) of Android being used

Samsung Galaxy S7 Edge (Samsung SM-G935F)
Android 7.0, API 24

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions