eneim / toro

Video list auto playback made simple, specially built for RecyclerView
Apache License 2.0
1.41k stars 253 forks source link

Playing in recyclerview #266

Open ghost opened 6 years ago

ghost commented 6 years ago

How to play all the visible item in recyclerview automatically ?

eneim commented 6 years ago

@vivekebics There is interface "PlayerSelector", it is feed by a list of Players and asked to select from there some player to start playback. You can simply returns all Player from the list.

Here Is an example of creating a custom PlayerSelector and set it to the RecyclerView.

Also, playing all possible players is bad practice, you are warned :).

ghost commented 6 years ago

@eneim Playing all the players is bad practice. If i want to show all the CCTV Footage in Android TV. How to achieve these ? Do we have any other possibilities ? Please let me know.

eneim commented 6 years ago

@vivekebics What is your use case by the way? If you want all the visible Video to start playback, you can have a custom "PlayerSelector", from "select" method you can just return all the player. It will use all players to play.

ghost commented 6 years ago

@eneim My use case CCTV Camera Monitoring in Android TV

eneim commented 6 years ago

@vivekebics try the following code for your container:

PlayerSelector SELECT_ALL = new PlayerSelector() {
    @NonNull @Override public Collection<ToroPlayer> select(@NonNull Container container,
        @NonNull List<ToroPlayer> items) {
      return items;
    }

    @NonNull @Override public PlayerSelector reverse() {
      return this;
    }
  };

  container.setPlayerSelector(SELECT_ALL);