There's still some internal to clean up to do, and in particular
it remains a TODO to be able to handle seek calls before the
timeline is set (for this CL, such calls are dropped). This change
does however finalize the API.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131171318
Window is potentially confusing with Android's Window class.
Once Window is renamed, it makes sense to rename Timeline too.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130938392
Also inline a few methods/classes where they can be made
private and therefore be removed from the public API.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130935090
- Use a single constant for unset/unknown times across
all time bases. Note also that this moves away from
use of -1 for unset/unknown times in ms, which was a
bad choice (it might conflict with real times, such
as a time representing being just behind the start
of a live window).
- Add a few other unset constants, and use them.
- Fix some hardcoding of -1 where existing constants
should have been used.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130775594
- Restore position to start of period if period is not
seekable, rather than not at all.
- Get the correct window when saving position.
- Disable position restore in onNewIntent.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130527704
- This change also enables seeking in live windows in the
ExoPlayer demo app.
- The added playlist doesn't transition properly by itself,
but for manual transitions it works correctly, and
demonstrates seeking into a default position.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130515880
This was always a bit of a hack; for Play Movies. It may well
no longer be necessary, and if not I'd like to think of a nicer
or more general way of doing it. We can always bring it back
if needed.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130373433
- This avoids the need to have to use the timeline to
calculate a window duration, which can be awkward.
- Window now represents a window of availability with
an isSeekable flag, rather than a window of
seekability.
- Promoted Timeline and Window to top package; they're
pretty important :).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130278509
This wont help much until the buttons to get the dialogs
to display are focusable! Use of MediaController seems to
make that tricky (to be continued...).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128989328
Useful functionality promoted to core library:
1. Management of SurfaceHolder.Callback lifecycle
promoted to SimpleExoPlayer
2. Ability to determine whether audio/video tracks
exist but are all unsupported promoted to
MappingTrackSelector.TrackInfo
3. Read external storage permissions check promoted
to Util
4. SubtitleView given ability to act directly as a
TextRenderer.Output to remove layer of indirection
5. SubtitleView given ability to configure itself to
user's platform wide caption styling
6. KeyCompatibleMediaController promoted to library's
UI package.
Relocation of boring stuff:
1. ID3 frame logging moved to EventLogger.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128714230
This change merges the duties of FormatEvaluator into
TrackSelection classes, so that both the static and
dynamic parts of track selection are implemented in a
single place.
New feature: Demo app now allows you to enable random
adaptation in the track selection dialog.
Notes:
- It should be quite easy to allow application side
track blacklisting in addition to source side, as an
extension to this. That would effectively allow
applications to do seamless/deferred track selection
by creating a TrackSelection with all tracks enabled,
and then toggling the blacklist flags to select the
ones they want to be active.
- It should be trivial to implement format blacklisting
for DASH and SS as an extension to this. Will do in a
follow up CL.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128707517
- Invoked --> Called
- Gets --> Returns
- "True if X. False otherwise." --> "Whether X."
- Removed some @returns where the Javadoc is in "Returns X" form
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128678638
It's only "needed" for HLS, and this requirement will
go away soon. It's safe to remove the flag ahead of
this because a TrackSelector can/should not attempt to
adapt between multiple audio/text tracks.
Also remove unnecessary restrictions on TrackGroups
being non-empty and only of known types.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128376601
- TrackSelection now exposes the selected formats, ordered
by decreasing bandwidth. This removes the need for DASH,
SS and HLS to do the sorting individually.
- The change also removes the need to reconstruct TrackSelection
instances with a different group index in various places
(e.g. MergingMediaPeriod).
- This is also a step toward potentially packaging the
FormatEvaluator inside of the TrackSelection (TBD).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128159064
SmoothStreaming -> Ss
MediaPresentationDescription -> DashManifest
DashSingleSegmentIndex -> SingleSegmentIndex
Moved DASH and Ss manifest classes to matching
manifest packages for consistency. For Hls the
package is called playlist still, since that's
what they're widely known as.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127925961
This also removes direct use of HttpURLConnection and
allows use of any HttpDataSource for license requests,
which means those using OkHttp can finally use the
same network stack for license requests as they're using
for everything else, without having to implement their
own callback.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127841045
With this change, MediaCodecRenderer acquires a session
from its DrmSessionManager whenever the DrmInitData in
the format changes. The DrmSessionManager is permitted
to return the same session if it can be re-used.
This plumbing adds support for:
1. Key-rotation, in the case that a key-rotation-aware
DrmSessionManager is used. Such an implementation will
return the same DrmSession for every aquisition, but
will be making use of multiple MediaDrm instances within
that session to enable the rotation.
2. Playlists with mixed clear and protected content. One
final piece to this will be to have each MediaPeriod
provide its own license URL. We could also allow each
MediaPeriod to specify the DRM UUID, but switching from
PlayReady to Widevine in a playlist seems like quite a
hypothetical thing.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127816046
There may be other ways to estimate bandwidth that don't
require listening to our own transfers.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127741651
This was possible previously, but now we support things
like multi-period DASH we need to do the injection in
the form of factories rather than concrete instances.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127735816
This change restores ExoPlayer to its previous behaviour.
I think we'll want a "resetPosition" boolean parameter on
setMediaSource at some point, but no need to add it right
now. Note that this would not always reset to the start
of the source. For a live playback it will reset to the
desired position (normally somewhere slightly behind the
live edge).
Issue: #1667
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127549700
In V1 we received complaints that Renderer was too locked down.
In particular, it wasn't possible to implement a Renderer that
wrapped another Renderer, since most of the methods were package
private and final (e.g. enable).
This change defines Renderer as a proper interface, removing
this limitation. A method-reordering-only change will follow
this one, to get things into a nice consistent/sane order in
each of the Renderer classes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127527995
1. Rename "extensions" package to "decoder". It's used by both
text and (should be used by) metadata, so it's no longer just
for extensions.
2. Move Buffer objects move into the decoder package.
3. Rename SubtitleParser and MetadataParser to SubtitleDecoder
and MetadataDecoder respectively, since they extend Decoder.
Ditto for all subclasses.
4. Subtitle and Metadata decoders now throw their own exception
types rather than ParserException.
5. Move MediaCodec classes into a mediacodec package, with the
exception of the concrete audio and video renderers.
6. Create an audio package to hold the two audio renderer classes
plus related util classes.
7. Create a video package to hold the one video renderer class
plus related util classes.
After this change the following nice properties hold:
1. Want a video renderer? Look in the video package. Ditto for
audio, text and metadata.
2. All TrackRenderer implementations use a decoder of some kind
to decode buffers received from the source, so we have
consistent terminology there.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127326805
The BandwidthMeter should only be used by MediaSource
instances and the objects they reference, so there's
really no reason for the player to need to know about it.
This change sacrifices DebugTextViewHelper showing the
estimated bandwidth, but I think that's a price worth
paying.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127316755
It doesn't look like TrackSelectionPolicy is going to be
useful other than with DefaultTrackSelector, and it's kinda
confusing dealing with both "selector" and "policy"
terminology. This change does the following:
DefaultTrackSelector -> selector.MappingTrackSelector
DefaultTrackSelectionPolicy -> selector.DefaultTrackSelector
TrackSelectionPolicy -> [deleted]
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127196326
There aren't really enough classes to justify it right
now, but if we're going to do a VideoView equivalent and
sensible player controls at some point, it's worth making
now to get classes into the correct place.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127184374
- The package is renamed to avoid conflicts with v1, should any
app wish to include both v1 and v2 for a period of time. This is
similar to the approach used by some other open source projects
(e.g. okhttp).
- Copyright year is updated everywhere for completeness.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126895326