648 Commits

Author SHA1 Message Date
Danny Brain
be85da3a69 Allow PlaybackControlView to be overridden in SimpleExoPlayerView 2017-07-26 11:34:49 +10:00
andrewlewis
554a399407 Switch to non-deprecated player constants
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162605429
2017-07-21 11:20:07 +01:00
aquilescanta
4f5ac9e04f Extract Player interface from ExoPlayer
This is the first step towards facilitating Cast integration to ExoPlayer.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162366198
2017-07-19 14:15:45 +01:00
bachinger
5be79d4f42 Media session extension to connect ExoPlayer with the MediaSession of the
framework.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162245883
2017-07-17 23:22:41 +01:00
olly
387720d182 Allow module registrations + log player release
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162223981
2017-07-17 23:21:34 +01:00
olly
0869802173 Show last seek position when playing an ad
We'd normally expect playback controls to be hidden during
ad playback, although if they are visible for whatever reason,
it makes sense to set the position to the current content
position now that we have it.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161950098
2017-07-15 17:31:01 +01:00
andrewlewis
94683d1e8c Show ad markers for non-multi-window time bars
Ads don't have their own periods any more, so show ad group markers even if the
time bar is not multi-window.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161524411
2017-07-12 18:15:53 +01:00
olly
b31fd5bc7c Misc tweaks to UI components
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161454491
2017-07-12 18:10:25 +01:00
andrewlewis
4180b9656d Show played ad groups
By default played ad groups are shown faded out. This helps the user know
whether they will see an ad when they seek to a given position.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161098491
2017-07-10 12:07:35 +01:00
andrewlewis
1f815db367 Switch the IMA extension to use in-period ads
This also adds support for seeking in periods with midroll ads.

Remove Timeline.Period.isAd.

Issue: #2617

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160510702
2017-06-30 16:35:14 +01:00
andrewlewis
db11e3ddb6 Show larger scrubber handle when focused
Also remove updateScrubberState as it doesn't do anything useful.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160496133
2017-06-30 16:30:52 +01:00
olly
a543436b96 SimpleExoPlayerView/DefaultTimebar fixes
- Restore making the playback controls visible on any key press.
- Turn anti-aliasing on for drawing the scrubber circle. It looks
  really ugly on some devices if you don't do this.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160413777
2017-06-28 22:26:05 +01:00
andrewlewis
96fa660284 Expose ad playback information on ExoPlayer
Also update the time bar to show ad markers using in-period ads and
remove support for periods being marked as ads.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160382805
2017-06-28 22:26:05 +01:00
Oliver Woodman
0f5c30d345 Misc cleanup 2017-06-13 13:35:10 +01:00
ojw28
c6dfccf393 Merge pull request #2756 from kiall/par-debugview
Include Pixel Aspect Ratio in DebugTextViewHelper
2017-06-13 13:21:01 +01:00
tonihei
fa4f876668 UI parameter to disable automatically showing playback controls.
(Fixing GitHub issue #2699)

Added controllerAutoShow parameter to decide whether playback controls are
shown automatically. Default is true. Can be overwritten in the XML with
auto_show=false or via SimpleExoPlayerView.setControllerAutoShow(false).

Also inverted the logic of maybeShowControllers and showController.
SimpleExoPlayerView.(show/hide)Controller and PlaybackControlView.(show/hide)
now unconditionally do what they say to allow manual operation.
SimpleExoPlayerView.maybeShowController is used internally to automatically
show playback controls.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158712277
2017-06-13 13:15:13 +01:00
Kiall Mac Innes
c24ef592e7 Include Pixel Aspect Ratio in DebugTextViewHelper
Add the video Pixel Aspect Ratio to the DebugTextViewHelper in order
to help debug issues related to PAR changes etc
2017-06-11 16:30:13 +01:00
olly
39b1c85c27 Expose current scrubber position through onScrubStart
Issue: #2910

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=158149904
2017-06-06 18:11:58 +01:00
andrewlewis
bcd4bf0fd5 Fix DefaultTimeBar invalidation
Issue: #2871

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=157562792
2017-05-31 11:42:24 +01:00
andrewlewis
84875bbe7b Constrain DefaultTimeBar maximum positions
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=156113616
2017-05-17 16:48:07 +01:00
andrewlewis
4963061923 Fix wrap_content handling in DefaultTimeBar
Issue: #2788

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=155705318
2017-05-11 05:53:20 +01:00
andrewlewis
a6220b8be3 Handle control layouts with no repeat button
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=155625893
2017-05-11 05:53:20 +01:00
tonihei
c70cd37c5a Repeat mode UI
Added repeat mode toggle buttons to UI. Current mode gets forwarded to
Exoplayer instance, but without playback behaviour changes yet.
Translations for button descriptions are also missing - this will be another CL.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=155386549
2017-05-08 22:30:58 +01:00
tonihei
df0d1b0f8a Removed superfluous dots in russian translation of repeat modes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=155386511
2017-05-08 22:29:52 +01:00
tonihei
ba9cbfbb91 Localized strings for repeat modes.
Related to GitHub Issue #2577.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=155078753
2017-05-04 20:56:59 +01:00
tonihei
4d1826dd3d Add repeat mode mechanics to Exoplayer.
(Relating to GitHub Issue #2577)

All getter, setter and callbacks have been added and value of repeatMode is
passed to getNextXXXIndex methods.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=155071985
2017-05-04 20:55:48 +01:00
andrewlewis
c3158d3e68 Improve DefaultTimeBar color customization
Add attributes for the scrubber handle color and unplayed color. If attributes
are missing, derive defaults from the played color.

Issue: #2740

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154825736
2017-05-04 20:50:05 +01:00
tonihei
6d2fa12e16 Add getNextWindowIndex to Timeline
(Preparation for Repeat Toggle Function - GitHub Issue #2577)

In addition, Timeline now also got a getPreviousWindowIndex and a
getNextPeriodIndex method with default implementations.

Changed ExoPlayerImplInternal and PlaybackControlView to use these
methods at all occurances of period and window index operations.

Note: Does not include repeat mode yet and no timelines are actually
using it so far. Please wait for the next CLs for this.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154520664
2017-05-04 20:45:31 +01:00
tonihei
0f9d9d56d6 Fix scrub seek position estimation for multi window time bar.
When using a multi window time bar, the onScrubStop method uses another
method to estimate the seek position than the updateProgress method for
rendering the time bar. If the time line contains windows starting with an
ad period followed by other content, they differ in their behaviour.
 - updateProgress checks all periods and leaves out all ad periods
 - onScrubStop only checks windows and leaves them out when the first
   period is an ad.

Changed onScrubStop to fit approach in updateProgess.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154271628
2017-04-26 15:18:36 +01:00
olly
9c2b0f6de2 Fix lint errors when building release
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154201059
2017-04-26 15:16:36 +01:00
olly
8e8a6a2994 Support efficient switching between SimpleExoPlayerView instances
Prior to this change, the only way to switch SimpleExoPlayerView
was to do:

oldView.setPlayer(null);
newView.setPlayer(player);

This would cause the video renderer to have to transition through
oldSurface->noSurface->newSurface, which is inefficient (noSurface
requires platform decoders to be fully released).

After this change we support:

newView.setPlayer(player);
oldView.setPlayer(null);

This results in direct oldSurface->newSurface transitions, which are
seamless on Android M and above. The change also adds some robustness
against developers ending up with strange behavior as a result of
clearing the player from a view in a different ordering than we expect
w.r.t. registering of other listeners.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154044976
2017-04-24 21:35:24 +01:00
olly
4c0b539054 Allow disabling hide on touch for SimpleExoPlayerView
Issue: #2501

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154036726
2017-04-24 21:34:12 +01:00
tonihei
579d57b445 Less memory allocations for repeated calls to SubtitleView.draw()
The draw method checks if all inputs are the same as in the previous call.
The options to strip the subtitle of its styles were applied each time,
in order to check if the final CharSequence is still the same.

This additional computation (and memory allocations) can be prevented by
checking if the original CharSequence (including all styles) and the
flags to remove those styles are the same. The actual style removal is now
part of setupTextlayout().

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=153061064
2017-04-18 19:36:08 +01:00
olly
12433ad146 Support intercepting setPlayWhenReady calls
Issue: #2454

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152938743
2017-04-18 19:34:39 +01:00
andrewlewis
147020f816 Hide player controls when an ad is playing
Also fix an issue where ad timelines with unknown ad period durations
would not be shown in multi-window mode. (The time bar doesn't use the
duration of ad periods, but shows a fix-size indicator instead.)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152666055
2017-04-11 12:15:04 +01:00
andrewlewis
4b94877476 Fix DefaultTimeBar vertical positioning in the demo app
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152492104
2017-04-11 12:15:03 +01:00
tonihei
ac0a4353da SubtitleView - New method setApplyEmbeddedFontSizes
When option is set to false, SubtitlePainter strips all absolute
and relative font size spans from the cue text.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152484724
2017-04-11 12:14:44 +01:00
Oliver Woodman
156bc52c8f Clean up DVB support
- Removed the PES_STRIPPED flag. It's unnecessary. We can strip
  PES in the TS extractor instead.
- Made nearly all of the object classes in DvbParser immutable.
  Else it's non-obvious that none of this state can be mutated.
- Made a a lot of the methods in DvbParser static for the same
  reason.
- Removed unnecessary null checks, code that was never executed,
  unused fields etc.
- Add proper flushing of DvbParser, to prevent corrupt output
  following a seek.
2017-04-06 19:16:31 +01:00
Oliver Woodman
538e71c090 Merge branch 'dev-v2-dvbsubs' of git://github.com/tresvecesseis/ExoPlayer into tresvecesseis-dev-v2-dvbsubs 2017-04-06 19:02:51 +01:00
andrewlewis
8208a75f0a Improve multi-window playback controls behavior.
Only enable multi-window mode when the duration of every period in the timeline
is known. Also, remove the warning logged when there are too many windows as it
doesn't add much.

The player's current period index was not masked while there were
unacknowledged seeks. This led to the displayed position jumping, between when
seekTo was called (after which the position would be masked but not the period
index) and the seek being acknowledged (at which point the time bar's position
would jump back to the seek position, due to the period index being resolved).
Mask the period index, like the window index, to fix this behavior.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152116040
2017-04-06 18:53:10 +01:00
andrewlewis
107e0ebc46 Fix scrubbing in timeline with too many windows.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=152003529
2017-04-06 18:49:34 +01:00
andrewlewis
9d20a8d41c Add a custom time bar view.
Also add an isAd flag to Timeline.Period so that periods can be declared as
containing ads. The times of these periods are indicated using ad markers in
the new TimeBar.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151116208
2017-03-31 18:57:42 +01:00
Sergio Moreno Mozota
d34d3f76be Pull request review fixes 2017-03-31 01:48:29 +02:00
andrewlewis
0e6ef0edf6 Add Sonic library for audio speed adjustment.
Add methods to ExoPlayer for setting/getting the playback speed, using
SonicAudioProcessor.

Remove PlaybackParams support, as the AudioTrack timestamp does not work
reliably on Marshmallow. The platform also uses Sonic and performance
should be comparable between the Java and native versions on recent Android
runtimes.

In a later change, SonicAudioProcessor will be made public so it can
be used in conjunction with other processors.

Issue: #26

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=151027121
2017-03-23 19:14:48 +00:00
Sergio Moreno Mozota
d8f61ad7e7 Add DVB subtitles support 2017-03-23 08:51:41 +01:00
aquilescanta
c32533cad8 Fixed the edit mode view for SimpleExoPlayerView
This CL makes SimpleExoPlayerView show a mock representation
when in the layout editor of AndroidStudio.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150739442
2017-03-22 19:05:05 +00:00
andrewlewis
f2e5c3b4c9 Fix imports.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150732864
2017-03-22 19:03:53 +00:00
olly
58ac572024 Tell Moe about new UI module + update external settings.gradle
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=150625313
2017-03-22 18:55:23 +00:00