exoplayer示例上的自定义UI [英] Custom UI on exoplayer sample

查看:918
本文介绍了exoplayer示例上的自定义UI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

**如果您一无所知,我真的需要帮助,这不会给我带来负面影响:|如果有什么麻烦您发表评论**

** I really need help if you don't know anything don't give me a negative point :| if something bother you comment**

我想在Exoplayer中为我的播放器编写自定义UI(更改暂停播放按钮或添加新按钮,例如下一个播放器速度等).

I want to write custom UI for my player in Exoplayer(change button of pause play or add new buttons like player speed next and etc) .

我使用来自github的Exoplayer示例,在将代码添加到原始项目之前,我想在官方示例中测试自定义UI.

I use Exoplayer sample from github and before add code to my original project, I want to test the custom UI on official sample.

我在Stackoverflow和tuts +中阅读了有关自定义UI的页面,但我真的很困惑!

I read pages in Stackoverflow and tuts+ about custom UI but I really confused!

为什么要更改某些按钮图像或更改其位置一定很困难:)我如何处理?

why change some buttons image or change their place must be so difficult :) how i can handle this?

编辑

这是示例 https://github.com/google/ExoPlayer/tree/master/demo

我读了这两篇文章:

http://www.brightec.co.uk/ideas/自定义Android媒体控制器

http://code.tutsplus.com/tutorials/create-a-music-player-on-android-user-controls--mobile-22787

根据此链接而不是编写自己的媒体控制器从头开始,您可以从Android附带的MediaController类开始",我问这个问题,因为我无法在exoplayer库上执行此步骤,并且教程是为默认媒体播放器编写的

according to this link "Instead of writing your own media controller from scratch, you could start with the MediaController class that is included in Android" and I ask this question because i can't do this steps on exoplayer library and tutorial is written for default media player

推荐答案

实际上,参与游戏的代码&暂停方法位于类 PlayerControl .

Actually the code of involking play & pause methods are in class PlayerControl.

如果您不想使用默认的Android媒体控制器用户界面,只需不要使用MediaController类,即可在布局文件中使用自定义播放和创建自己的用户界面.暂停按钮,并将操作与按钮的onClickListener绑定.

If you don't want to use default Android media controller UI, just don't use the MediaController class, create your own UI in your layout file with custom play & pause button and bind the actions with the button's onClickListener.

要播放视频,请致电exoPlayer.setPlayWhenReady(true);

要暂停:请致电exoPlayer.setPlayWhenReady(false);

如何为android MediaController创建自定义UI的情况与此类似./a>

It's similar problem with how to create custom UI for android MediaController

这篇关于exoplayer示例上的自定义UI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆