satorufujiwara / exoplayer-textureview

ExoPlayer's wrapper for using with TextureView.
Apache License 2.0
134 stars 19 forks source link

Media controller for player. #12

Open Shaikjalal opened 8 years ago

Shaikjalal commented 8 years ago

Hi,

Wondering if there is a media controller implementation for this? Do we implement media controller in VideoTexturePresenter?

ypresto commented 7 years ago

Currently there is no interface to use MediaController. It only can be done through reflection:

        try {
            Field playerField = VideoTexturePresenter.class.getDeclaredField("player");
            playerField.setAccessible(true);
            Player player = (Player) playerField.get(videoTexturePresenter);
            mediaController.setMediaPlayer(player.getPlayerControl());
        } catch (IllegalAccessException | NoSuchFieldException e) {
            Log.e("VideoHeaderRenderer", "Cannot get player control.", e);
        }