Skip to content

5. PlayerViewHelper: Toro's right hand

Nam Nguyen Hoai edited this page Oct 23, 2016 · 2 revisions

A powerful Helper, support every RecyclerView's child ViewHolder by connect it to Toro's powerful API. PlayerViewHelper is an abstract implementation for some most significant callback from the Playback as well as ViewHolder's lifecycle.

PlayerViewHelper stays between a ViewHolder, a specific Media Player API and Toro's API. Therefore, an extension for it will tie to a specific Media Player API. You can see my default implementation in each extension module. User of Toro can extend current implementation for corresponding Extension project, or learn from default implementation for custom extensions.

Usage: one PlayerViewHelper instance will be tie 1 - 1 to a ViewHolder. It listen to ViewHolder's lifecycle event as well as playback events to trigger Toro's internal APIs. See ExoVideoViewHolder.java for an example.

Clone this wiki locally