exoplayer

Mute audio on ExoPlayer

别来无恙 提交于 2019-12-18 01:28:32
问题 I'm using Google new MediaPlayer named ExoPlayer and cannot find a way to mute the sound Is there an easy way to mute audio track on Google ExoPlayer ? Or changing volume ? 回答1: Exoplayer 2.x.x Get the current volume: int currentvolume = player.getVolume(); Mute: player.setVolume(0f); Unmute: player.setVolume(currentVolume); Exoplayer 1.x.x I found two ways to achieve it by editing DemoPlayer from ExoPlayer. Good one : Basicly, you need to get the audioTrackRenderer which is a

Not able to get getDuration() for AAC file using ExoPlayer

♀尐吖头ヾ 提交于 2019-12-17 14:58:42
问题 I have been trying to stream a URL using ExoPlayer . The URLs: STREAM_URL_1 = "http://storage.googleapis.com/exoplayer-test-media-0/play.mp3" STREAM_URL_2 = "https://s3-ap-southeast-1.amazonaws.com/ok.talk.channels/zakirkhan/Zakir+khan+-+when+my+father+took+my+gf%27s+call.aac" Both URLs play but I am not able to get the getDuration() for STREAM_URL_2 which is an .aac file. The .mp3 works. The following is how I do it. How do I get the getDuration() for the 2nd URL. Even seekTo() doesn't work

Quality selector for ExoPlayer 2

老子叫甜甜 提交于 2019-12-17 06:49:10
问题 I am currently developing a live and movie player application. I chose ExoPlayer version 2 to play the movie and I do not know much about it. I want to let the user choose the quality of a movie on the player screen, for example, 720p or 1080p or etc. But I do not know how to get a list of existing qualities and show them to the user. and the below code is my implementation of SimpleExoPlayer : private void initPlayer(String path){ Handler handler = new Handler(); // 1. Create a default

get buffered data exoplayer

£可爱£侵袭症+ 提交于 2019-12-13 07:05:00
问题 I am not very experienced building Android apps and I am trying to make a small app using ExoPlayer. So hopefully you guys can pardon my ignorance. I am essentially trying to see if there is a way to get access to the buffered files. I searched around, but there doesn't seem to be an answer for this. I saw people talking about cacheDataSource, but then I thought, isn't the data already being cache by virtue of it buffering? For instance, when a video starts, it start buffering. I t continues

com.google.android.exoplayer2.source.UnrecognizedInputFormatException:

巧了我就是萌 提交于 2019-12-13 03:55:57
问题 I need to reproduce a live show with exoplayer in format .mpd. But i get this error: com.google.android.exoplayer2.source.UnrecognizedInputFormatException: None of the available extractors (MatroskaExtractor, FragmentedMp4Extractor, Mp4Extractor, Mp3Extractor, AdtsExtractor, Ac3Extractor, TsExtractor, FlvExtractor, OggExtractor, PsExtractor, WavExtractor) could read the stream. I don't know why! This is my code: public class MainActivity extends AppCompatActivity { SimpleExoPlayer exoPlayer;

How to modify audio processors on the fly

馋奶兔 提交于 2019-12-13 03:48:46
问题 I need to implement audio channel mapping using ExoPlayer so that I can listen to one channel from both earphones at the time. For that I am using ChannelMappingAudioProcessor and it works, except I need to be able to change the mapping on the fly. The thing is, you can define the processors when creating an instance of the ExoPlayer (I do it with Dagger and I inject it into the ViewModel) but once instance is created, there is no way (afaik) to get the processor/renderer from the instance

onBackPressed() Orientation Issue

好久不见. 提交于 2019-12-12 19:53:37
问题 Activity supports Landscape mode <activity android:name=".MainActivity" android:configChanges="orientation|screenSize|keyboardHidden" android:screenOrientation="landscape" android:label="@string/app_name" > where I have allocated 50% space to Video Player (using FrameLayout) and rest 50% to ListView . <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"

Adjust Dash stream volume with Android Exoplayer

放肆的年华 提交于 2019-12-12 12:27:45
问题 I'm trying to set up a seekbar to control the level of an instance of exoplayer streaming dash. The setup I am using is a modified version of the demo project and am having trouble figuring out which element I should be trying to affect with the seekbars output ie how to use MSG_SET_VOLUME properly etc etc Any input would be massively appreciated. The end result I am looking for is an application with two instances of exoplayer both streaming dash content with a fader(seekbar) controlling the

Streaming a YouTube live video (DASH) to Android app with ExoPlayer

与世无争的帅哥 提交于 2019-12-12 09:04:10
问题 I am making an app that can stream a live YouTube video to my app. I want to use ExoPlayer. I went through the demo app of ExoPlayer, and the URL they use in DASH streaming is something like this : "uri":"http://www.youtube.com/api/manifest/dash/id/bf5bb2419360daf1/source/youtube?as=fmp4_audio_clear,fmp4_sd_hd_clear&sparams=ip,ipbits,expire,source,id,as&ip=0.0.0.0&ipbits=0&expire=19000000000&signature=51AF5F39AB0CEC3E5497CD9C900EBFEAECCCB5C7.8506521BFC350652163895D4C26DEE124209AA9E&key=ik0"

How to get video from web socket url in android?

社会主义新天地 提交于 2019-12-12 05:49:00
问题 I want to get a video mp4 file from web socket URL in android, The URL look like the following example: "ws://xxxx.xxxx.xxxx.com/mp4 I have no idea if its possible in exoplayer , and if so then how is it possible in a web socket url (Not Http). I would be happy to receive any example to this problem 回答1: Take a look at okhttp from 3.5.0 they support websockets. Then you can OkHttpDataSource with ExoPlayer. 来源: https://stackoverflow.com/questions/44725871/how-to-get-video-from-web-socket-url