Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support app specified ad markers in player UI #3184

Closed
tonihuotari opened this issue Aug 17, 2017 · 4 comments
Closed

Support app specified ad markers in player UI #3184

tonihuotari opened this issue Aug 17, 2017 · 4 comments
Assignees

Comments

@tonihuotari
Copy link

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

@andrewlewis andrewlewis self-assigned this Aug 17, 2017
@andrewlewis
Copy link
Collaborator

Are you using PlaybackControlView? Please could you set a breakpoint in setAdGroupTimesMs and check if your ad markers are being overwritten by the player?

@tonihuotari
Copy link
Author

Yes there seems to be values overwritten when setAdGroupTimesMs gets called in PlaybackControlView.updateProgress

@andrewlewis
Copy link
Collaborator

Probably this only worked before because we only set the ad group times if the view was showing a multi-window time bar. As of r2.5.0 we always set the ad markers (and ad timelines aren't multi-window any more).

Marking this as an enhancement to let apps specify ad markers that override whatever the player provides. As a workaround for now, you could subclass DefaultTimeBar and override setAdGroupTimesMs to use your own ad group times (ignoring what's passed in). See the blog post on customizing UI components for information on how to use this custom time bar.

@tonihuotari
Copy link
Author

Your suggested workaround works, I'll use it until it is fixed. Thanks @andrewlewis

@ojw28 ojw28 changed the title Ad markers not visible for versions 2.5.0, 2.5.1 Support app specified ad markers in player UI Aug 17, 2017
ojw28 pushed a commit that referenced this issue Aug 23, 2017
Issue: #3184

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165895259
ojw28 pushed a commit that referenced this issue Sep 6, 2017
Issue: #3184

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165895259
ojw28 pushed a commit that referenced this issue Sep 9, 2017
Issue: #3184

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165895259
hishamMuneer added a commit to hishamMuneer/ExoPlayer that referenced this issue Sep 14, 2017
* Minimal change to expose segment indices in DefaultDashChunkSource

Issue: google#3037

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164614478

* Clean up terminology for MediaSession extension

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164705750

* Fix minor Javadoc error

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164706078

* Document usage of the RTMP extension

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164706135

* set mediaSession flags properly and keep queue in sync when timeline changes

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164774783

* Support multiple video/text/metadata outputs

We've seen more than one issue filed where a developer has
registered a video listener and been confused by the fact
their SimpleExoPlayerView no longer works properly. There
are also valid use cases for having multiple metadata/text
outputs.

Issue: google#2933
Issue: google#2800
Issue: google#2286
Issue: google#2240

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164839882

* Fix maskingX variables when timeline becomes empty

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164840037

* Restrict usage of secure DummySurface for all Samsung devices.

* Support H262 video in MP4

* Fix possible subrip timing line NPE

* Support crop mode for AspectRatioFrameLayout

* Add flag to CachedContentIndex to disable encryption.  This allows the encryption feature
to be disabled gracefully: encrypted index files may be read, but plaintext will be written.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165196508

* Disable secure dummy surface on all Samsung N devices

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165291627

* Update instructions to include Google Maven repository

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165291982

* Destroy GL context when releasing dummy surface

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165293386

* Restore the interrupted flag after blocking operations

If the main thread was interrupted during
ExoPlayerImplInternal.blockingSendMessage/release, the interrupted flag was
immediately set but then wait() was called on the next iteration. wait() would
immediately throw InterruptedException, causing the main thread to spin until
the blocking operation completed.

Instead of resetting the flag immediately, reset it after the blocking
operation completes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165426493

* Work around issue with Xiaomi JB devices

Issue: google#3171

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165577562

* Improve FORMAT_UNSUPPORTED_DRM related documentation and logging

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165580016

* Improve MediaSource/MediaPeriod documentation

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165628229

* expose setPropertyByteArray, setPropertyString

export setPropertyByteArray, setPropertyString of DefaultDrmSessionManager for easy customization.

* Minor style tweaks

* Allow the app to specify extra ad markers

Issue: google#3184

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165895259

* Remove isFirstWindow/isLastWindow from Timeline.

These methods are only used in one place, and offer duplicate
functionality to checking getNext(Previous)WindowIndex == C.INDEX_UNSET.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165910258

* Fix broken link + minor doc tweak

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165920927

* Handle size==0 in MP4 atoms

Issue: google#3191

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165925148

* Use flavorDimensions for external demo app

- This is soon becoming mandatory.
- It also looks like future versions of com.android.tools.build
  are being distributed via Google's Maven repository.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166058299

* Support aspect ratio fill mode for AspectRatioFrameLayout

* Support zoom mode for AspectRatioFrameLayout

* Allow subclasses to customize the MediaFormat

Make getMediaFormat protected so that subclasses can set additional MediaFormat
keys. For example, if the decoder output needs to be read back via an
ImageReader as YUV data it is necessary to set KEY_COLOR_FORMAT to
COLOR_FormatYUV420Flexible.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166195211

* Use Math.abs in Sonic.java

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166820970

* Add support for new codecs parameter string

* google#3215 Additional secure DummySurface device exclusions

* Use UTF-8 everywhere

UTF-8 is the default charset on Android so this should be a no-op change, but
makes the code portable (in case it runs on another platform).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167011583

* Fix ContentDataSource bytesRemaining calculation

The bytesRemaining didn't always take into account any skipped bytes, which
meant that reaching the end of the file was not correctly detected in read().

Issue: google#3216

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167016672

* Allow more aggressive switching for HLS with independent segments

We currently switch without downloading overlapping segments, but
we do not actually switch more aggressively. This change fixes
this. Note there's an implicit assumption made that if one media
playlist declares independent segments, the others will too. This
is almost certainly true in practice, and if it's not the penalty
isn't too bad (the player may try and switch to a higher quality
variant one segment's worth of buffer too soon).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167120992

* HDR 10 bits: Use a separate sampler for U and V dithering.
Using the same sampler introduced some minor horizontal scratches.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167347995

* Fix typo

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167474040

* Minor cleanup to AspectRatioFrameLayout

* Update moe eqiuvalence

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167488837

* Allow EXIF tracks to be exposed

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167493800

* Adding missing license header in IMA build.gradle

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167496569

* Additional secure DummySurface device exclusions

Merge: google#3225

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167502127

* Be robust against unexpected EOS in WebvttCueParser

Issue: google#3228

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167504122

* Rewrite logic for enabling secure DummySurface

Issue: google#3215

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167505797

* Upgrade gradle plugin / wrapper

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167579719

* Don't use MediaCodec.setOutputSurface on Nexus 7 with qcom decoder

Issue: google#3236

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167581198

* Fix position reporting during ads when period has non-zero window offset.

Reporting incorrect positions for ad playbacks was causing IMA to
think the ad wasn't playing, when in fact it was.

Issue: google#3180

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167702032

* Workaround for SurfaceView not being hidden properly

This appears to be fixed in Oreo, but given how harmless
the workaround is we can probably just apply it on all
API levels to be sure.

Issue: google#3160

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167709070

* DecryptionException cleanup + add missing header

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167711928

* Pick up rtmpClient fix

Issue: google#3156

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167718081

* Enable rtmp in external demo app with extensions

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168007345

* Destroy EGLSurface during DummySurface cleanup

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168020525

* Fix attr inheritance in SimpleExoPlayerView

When creating PlaybackControlView inside SimpleExoPlayerView,
we want certain attributes to be passed through. This lets you
set control attributes on the SimpleExoPlayerView directly. We
don't want all attributes to be propagated though; only our own
custom ones.

Not sure if there's a cleaner way to do this. Pragmatically this
solution seems ... ok :)?

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167619801

* Add possibility of forcing a specific license URL in HttpMediaDrmCallback

Resubmit of google#3136

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164971900

* Fix build for release

* Bump to 2.5.2

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168155713

* Update extension README with usage instructions

Issue: google#3162

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165572088

* Tweak and add READMEs + remove refs to V1

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165578518

* Update README.md
@google google locked and limited conversation to collaborators Dec 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants