Skip to content

Releases: eneim/toro

Release 3.4.0 (2018/03/05)

04 Mar 13:44
Compare
Choose a tag to compare

3.4.0 (2018/03/04)

3.4.0 is the biggest release since 3.0.0. In short, many issues are fixed, many internal improvement and many new ways to start your new playback. This changes also focus on ExoPlayer so that using ExoPlayer with Toro is easier than ever before.

  • toro-core

    • Add PlayerDispatcher: this interface intercepts the call to ToroPlayer#play(), and tells the library 'how long should this call be delayed'. It is useful when client need some delay before the playback starts. PlayerDispatcher works with PlayerManager and can be setup using Container#setPlayerDispatcher(PlayerDispatcher). Defaul PlayerDispatcher dispatch the call immediately.
    • Improve PlayerSelector: the ToroPlayer list in parameter of PlayerSelector#select() is always sorted, while the order is unclear to the caller. This release adds the annotation Sorted telling the caller if a list is sorted by which order (either ASCENDING or DESCENDING).
    • ToroPlayer: ToroPlayer#onSettled(Container) is deprecated and will be removed in next major release (3.5.0).
    • ToroPlayerHelper: instance of Container is no longer required when constructing an instance of this class. This brings flexibility and usability to the subclass of this helper. Also, it removes the concern about sharing instance of this helper across different Containers. Along with this update, initialize(PlaybackInfo) is deprecated and replaced by initialize(Container container, PlaybackInfo). Sub class still need to override initialize(PlaybackInfo) for backward compatibility, but it is recommended to use/call the new one in practice.
    • ToroPlayerHelper: default behavior when the ToroPlayer state changes to play or pause is changed. When ToroPlayer's state is playing, the player View will keep the screen on, and when the state is pause, player View will not keep the screen on.
    • This release adds setVolume(float) and getVolume to the helper as well. Sub classes must provide a volume control for this change.
    • DrmMedia adds method multiSession() that returns a boolean telling if the Drm playback should supports multi sessions or not. This adapts the change from ExoPlayer, but not depend on it.
  • toro-exoplayer (Toro Extension for ExoPlayer 2)

    • Has been vastly rewritten. Building new SimpleExoPlayer instance is now easier and more flexible than before. And the instance will be cached for re-use, which shows significant performance improvement. Client now has the simpler and safer way to integrate ExoPlayer into ToroPlayer, and also the ability to use ExoPlayer separately to ToroPlayer's API with the same flexibility.
    • This release comes with some new helper classes, including ToroExo, ExoCreator, Config, Playable, ExoPlayable, MediaSourceBuilder.
    • ExoCreator: this is the main character, playing the roles that create new SimpleExoPlayer instances, MediaSource instances and also Playable instance.
    • Config: this class defines the necessary setup for a SimpleExoPlayer as well as MediaSource. Its instance can be built using Builder, which gives client the ease of use and the flexibility to reuse the Config instance (By calling Config#newBuilder(), client can simply clone the Config and update it with different options). Also, it is recommended to have global instance of Config for each client, and if it requires different configs, the number of config should be kept as small as possible.
    • Playable: similar to ToroPlayer in that it defines core playback control such as play/pause and volume update. But this interface is built for ExoPlayer components, and deeply integrates into its API. Instance of this interface can be used either in a subclass of ToroPlayerHelper to support a ToroPlayer, or individually as a single playback controller. Playable is designed to be resuable, even across configuration change, so that client can keept the playback smoothly in those changes.
    • ExoPlayable: an implementation of Playable where client can extend it for customization with flexibility.
    • MediaSourceBuilder: a single interface tells client how should a MediaSource should be created, and ask for the implementation. Providing the Config by an instance of this interface is enough for the rest of your app.
    • ToroExo: the manager for this new update. It hides the complexity of implementations of ExoCreator or Playable, gives client necessary but powerful entry points to request for those instances. Also, initiating this class is just as simple as calling ToroExo.with(context) you may see else where. ToroExo.with(Context), ToroExo#requestPlayer(ExoCreator), ToroExo#releasePlayer(ExoCreator, SimpleExoCreator), ToroExo#getCreator(Config), ToroExo#getDefaultCreator() are only methods you need to remember.
    • ExoPlayerViewHelper is renamed from ExoPlayerHelper and also a rewritten version of it. It is the combination between ToroPlayerHelper and ExoPlayable, brings the best of this release to user of toro.
    • SimpleExoPlayerViewHelper is deprecated, client should use ExoPlayerViewHelper instead. This class will be removed from next major release (3.5.0).
  • toro-mopub

    • The changes for this extension is almost the same with the toro-exoplayer, while its responsibility is to keep the compatibility with ExoPlayer r2.4.4, which is non-trivial.
    • The addition interfaces are the same, but their signature are slightly different. Client is recommended to check out the source to take a look. But to use them, it is just as simple as calling the same methods from ToroExo with the same set of options as in toro-exoplayer.
    • PlayerView is added. It is a clone of SimpleExoPlayerView where there are some addition improvement brought from ExoPlayer 2.7.0.
    • ToroControlView is added, with a custom UI where user can also change the Volume. This options is not available in official ExoPlayer Widgets, which is the reason why I create this View.
    • The old MediaSourceBuilder is renamed to MediaSourceCreator and also be created in favor to the new setup for ExoPlayer.
    • The new MediaSourceBuild class is added to work with new building system for ExoPlayer.
    • Helpers for ToroPlayer are now: PlayerViewHelper for new custom PlayerView and ExoPlayerViewHelper for SimpleExoPlayerView.
  • Demo

    • Add demo-exoplayer that contains simple Activities to show how to use the new ToroExo with all other new classes, either with Container or as single Media player.
    • Add demo-mopub to show how to use toro-mopub extension effectively.
  • Others

    • toro-exoplayer now uses ExoPlayer 2.7.0 as dependency.
    • app the demo app is also updated with latest ExoPlayer version and latest improvement from toro-exoplayer.

Release 3.4.0-Alpha3 (2018/02/24)

24 Feb 14:26
67bff6c
Compare
Choose a tag to compare
Pre-release
  • toro-core

    • Add PlayerDispatcher to provide more flexible playback. In detail, it can delay the call to ToroPlayer#play() where the delay time is configurable by client. Default behavior is no delay.
  • toro-exoplayer

    • Now compile with ExoPlayer version 2.7.0. There are breaking changes in that library, so clients of Toro are expected to migrate them. The migration is trivial.
  • All demo apps are now compile with ExoPlayer version 2.7.0.

Release 3.3.0 (2018/01/01)

01 Jan 13:19
Compare
Choose a tag to compare

This release contains breaking changes, minor migration may be required.

API Updates

  • BREAKING CHANGE: Remove ExoPlayer API from Core. This is to remove the dependant of Toro from ExoPlayer. Some libraries may use older version of ExoPlayer. Current implementation of ExoPlayer is released as separated extension for Toro, User should add the following entry to gradle:
implementation "im.ene.toro3:toro-ext-exoplayer:${toroVersion}" // same version as Toro
  • BREAKING CHANGE: ExoPlayer extension is released as separated library (see above). This extension will always use latest version of ExoPlayer. For this time's release, it is 2.6.0. User can refer to its implementation to support different version which doesn't binary compatible (for example r2.4.4).

Internal Updates

  • Various implementation improvement.

Demo App Updates

  • YouTube demo application is improved, full-screen player is added. Forkers of this library are required to provide their own application Id for YouTube demo app (see gradle.properties-sample) for the key.

Release 3.2.0 (2017/11/23)

22 Nov 13:44
Compare
Choose a tag to compare

3.2.0 is a breaking change. It cannot compatible with 3.1.x and below. But migration should be easy as only 2 methods are changed and one interface is removed. This release will also make scrolling with many Videos smoother. Sorry for making you wait!

See the changes by yourself here

API Updates

  • BREAKING CHANGE: ToroPlayer#onContainerScrollStateChange(Container, int) has been removed, replaced by ToroPlayer#onSettled(Container).
  • BREAKING CHANGE: ToroPlayer#onCompleted(Container, ToroPlayer) has been removed, replaced by ToroPlayer#onCompleted().
  • BREAKING CHANGE: ToroLayoutManager has been removed. Internal implement now doesn't depend on first and last ViewHolder indicator.

Internal Updates

  • ToroUtil#visibleAreaOffset() implementation now doesn't require ViewParent to be a Container anymore.
  • Common#allowsToPlay() implementation improved.
  • Container and PlayerManager internal implementation has been significantly improved.

Demo App Updates

  • Minor coding improvement for Youtube demo.

Release 3.1.1 (2017/10/06)

11 Oct 04:09
Compare
Choose a tag to compare

Internal Updates

  • Inline documentation is improved. (I was bad at documenting things, sorry).
  • ExoPlayer version is updated to 2.5.3.

Demo App Updates

  • Add demo with single player activity, where User can click to a Video to start a dedicated Player for it. Read source code for more information.

Release 3.1.0 (2017/09/05)

05 Sep 05:59
Compare
Choose a tag to compare

API Updates

  • Inline documentation is improved.
  • ExoPlayer version is updated to 2.5.1 (This version is not binary compatible with 2.4.x).

Bug fixes

  • Fix a bug where Container keeps playing while Device Screen is turned off.

Release 3.0.0 (2017/08/02)

02 Aug 01:19
Compare
Choose a tag to compare

API Updates

  • Add ToroPlayer#onContainerScrollStateChange to allow ToroPlayer to hook into Container scroll state change event.
  • Add ToroPlayerHelper#onContainerScrollStateChange which does nothing, so that sub class can used to provide helpful support for ToroPlayer.
  • ExoPlayer version is updated to 2.4.4

Demo app update

  • Add ViewPagers in ViewPager demo, which demonstrates how to handle more complicated use case where user have ViewPager inside Fragment which in turns is inside another ViewPager. (The problem is when a ViewPager is shown to the user).

  • Add app-youtube module to show the use of toro with Youtube video, using Android Youtube Player API. To be able to build this module, user must provide a youtube api key to gradle.properties (see gradle.properties-sample for the key, replace the dummy key to the actual key, rename this file to gradle.properties as usual and build).

Other update

  • toro now requires Android Studio 3.0 to develop.

Release 3.0 Beta 1 (2017/07/07)

08 Jul 09:57
Compare
Choose a tag to compare
Pre-release

Please read CHANGELOG.md for release detail.

Release 3.0 alpha 2 (2017/06/30)

30 Jun 02:19
Compare
Choose a tag to compare
Pre-release

Changes

  • Drop support to VideoView (via ToroVideoView and LegacyVideoViewHelper). User can find a demo of using VideoView in demo app, legacy package.

  • Move PlayerSelector from im.ene.toro.widget to im.ene.toro.

  • Method name change: ToroPlayerHelper#updatePlaybackInfo becomes ToroPlayerHelper#getLatestPlaybackInfo.

  • All initialize method now requires a Nullable PlaybackInfo (was Nonnull).

Update

  • Add demo for VideoView.

Others

  • Minor coding improvement and documentation improvement.

Release 3.0 alpha 1 (2017/06/24)

25 Jun 04:21
Compare
Choose a tag to compare
Pre-release

Toro 3.0 is a completely rewritten version of Toro. I borrow just a few helper from 2.x.

Toro 3.0 removes the use of static setup (Toro.attach/detach/init/register/unregister ...), which was a burden for both maintainer and users. Instead, all the necessary logic is put into Container - an empowered RecyclerView. The fact is, in the RecyclerView eco-system (RecyclerView, Adapter, LayoutManager, ViewHolder, ...), RecyclerView is the least likely to be customised. With that, I put my effort to integrate the beauty of Toro 2.x into a single RecyclerView. As a result, user just need to replace their RecyclerView with Container view to have the support from Toro.

Also, there is no need to implement the MediaPlayerManager which is tight to Adapter in Toro 2. I was struggling with this constraint for a long time after the release, and finally I know it must be removed. In Toro 3, there is no customisable MediaPlayerManager, its logic is instead integrated inside Container.

What user still need to do, is to implement the Player interface into the ViewHolder. This is a must, since there is no other way the Container could know if it is talking to a Player or not. But instead of dozens of methods in Toro 2.x, the ToroPlayer interface now contains only a few methods which are enough to control the playback, and few more for the callback from the playback update.

Deep inside the implementation, Toro 3.0 is no longer listen to Playback state. In fact, it was a pain in my ass when I try to follow the state machine of 3 Media player APIs (MediaPlayer, ExoPlayer 1, ExoPlayer 2) to tell Toro instance to deal with a Player when it is ready to play or when it completes the playback. In Toro 3.0, it is now just asking the Player to initialize the resource for playback, and then start it, or pause it, on demand. All the playback state update is ignore by Toro, and users will have the freedom to integrate their own callback logic.

This also asks the users more to handle the callback by themselves, so in fact, I put 2 helpers classes to help them getting start with Toro 3.0 easier. Right now only ExoPlayer 2.+ and Android MediaPlayer are supported. And there will be no plan to support more playback SDK. But as users will need to implement 3rd party SDK such as Youtube, Video, etc, I'm always try to help as much as possible.

More detail about how to use Toro 3.0 alpha 1 can be found in README as well as the sample app. So it is highly recommended to go though the README as well as app module before asking for any implementation details.

What happens with Toro 2.x: I will try to answer as much as possible, and fix fatal issues only. All up coming development will go to 3.+ and so on.