exoplayer

ExoPlayer - how to play local mp3 file

徘徊边缘 提交于 2019-12-03 06:35:43
I'm trying to use ExoPlayer instead of MediaPlayer because it's a common bug that MediaPlayer returns wrong getCurrentPosition() and I need a substitute. But I can't find an info anywhere how to open a local file through the file path to the file same as MediaPlayer's .setDataSource(String filepath) Google doesn't have any example and the official documentation site strangely crash my FireFox browser on both computers The ExoPlayer demo app in github can be modified to play local files. To do that, edit https://github.com/google/ExoPlayer/blob/master/demo/src/main/java/com/google/android

YouTube video playback with ExoPlayer [closed]

时光怂恿深爱的人放手 提交于 2019-12-03 05:03:01
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I am interested in using the ExoPlayer for YouTube video playback. I see from the ExoPlayer samples that they play YouTube videos via DASH URLs. I'm using the Android YouTube API to search for videos, and don't see a means for obtaining a DASH URL for any of the search results. Is someone aware of any samples for

How to add Subtitles(.SRT files) to video in Exoplayer android?

社会主义新天地 提交于 2019-12-03 04:23:31
i am working on a project where i should play .srt files along with video in android. I was working through the samples of Exoplayer but cant able to play .srt files with video. The code i used is, MediaSource mediaSource = new HlsMediaSource(Uri.parse("https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8"), mediaDataSourceFactory, mainHandler, null); Format textFormat = Format.createTextSampleFormat(null, MimeTypes.APPLICATION_SUBRIP, null, Format.NO_VALUE, Format.NO_VALUE, "en", null); Uri uri = Uri.parse("http://www.storiesinflight.com/js_videosub/jellies.srt"); MediaSource

Exoplayer playing m3u8 files Android

匿名 (未验证) 提交于 2019-12-03 02:51:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: After trying multiple ways of playing m3u8 files using videoview and mediaplayer I decided to give up. Everytime i play the m3u8 file I only hear the voice.(please dont write urls from stack overflow answering my question. I' ve red them all ) Been asking around ,finally got to know that exoplayer maybe is the one I'm looking for. However exoplayer seems to be a newbie and I can'n find any proper tutorial . That been said Im myself a newbie and all talks about tracker and blabla seem just too complicated for me. I only want to be able to

Google ExoPlayer guide

匿名 (未验证) 提交于 2019-12-03 02:49:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am struggling to build basic app with ExoPlayer. 回答1: First you need to add this in your build.gradle compile 'com.google.android.exoplayer:exoplayer:r2.1.1' 1. Your Layout File <?xml version="1.0" encoding="utf-8"?> <RelativeLayout 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" > <com.google.android.exoplayer2.ui.SimpleExoPlayerView android:id="@+id/player_view" android:focusable="true" android:layout_width=

YouTube video playback with ExoPlayer

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am interested in using the ExoPlayer for YouTube video playback. I see from the ExoPlayer samples that they play YouTube videos via DASH URLs. I'm using the Android YouTube API to search for videos, and don't see a means for obtaining a DASH URL for any of the search results. Is someone aware of any samples for integrating the YouTube API (v3) with the ExoPlayer (without using hardcoded video urls), or know of a way to get the information I need from the YouTube API to load the video into the ExoPlayer? 回答1: For getting DASH URL, you need

Exoplayer adaptive hls streaming

匿名 (未验证) 提交于 2019-12-03 02:18:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am looking for good and simple example/explanation how to implement ExoPlayer for HLS Adaptive streaming. I am a newbie and do not have experience and knowledge so I can figure how to do this from code example on git. There are too many 'moving parts' so beginner can understand and reuse it in own projects. Can somebody help me to learn and understand how to use/implement ExoPlayer in order to achieve this functionality? Thanks! 回答1: The easiest way to get started using ExoPlayer is to add it as a gradle dependency. You need to make sure

Using cache in ExoPlayer

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm looking for any example of implementing cache in ExoPlayer. ExoPlayer has in its library different classes concerning cache and Google explain in this video that we can implement it with the CacheDataSource class, but Google doesn't provide any demo on it. Unfortunately this seems pretty complicated to use, so I'm currently looking for examples (no success on Google). Does anyone succeed or has any info that would help ? Thanks. 回答1: Here is the solution for ExoPlayer 2.+ Create a custom cache data source factory class

How to play video full screen in landscape using exoplayer

帅比萌擦擦* 提交于 2019-12-03 01:59:26
I am using exoplayer to play video from url in my android app. In portrait everything work as expected (using viewpager, fragments and tabs inside activity). My goal is to play the video in full screen when the user is in landscape. It means only the video will play in landscape and all other details will desapear and return back to the original layout when portrait. How can I achieve this please? or what is the best way to achieve this? any sample code will be appreciate. i am a noob so this is the best i can help with, btw I tested this in the Exoplayer Demo application, i changed the

ExoPlayer - play 10 files one after another

狂风中的少年 提交于 2019-12-03 01:26:46
I have 10 video i need to play, once one is done, the next one starts to play. I'm using Google's ExoPlayer , I use the example in the DEMO @ GitHub . I can play 1 video but if i try to play the next one, it wont start. If i try to reInit the player, and the start playing again, it crashes. private void loadvideo() { Uri uri = Uri.parse(VIDEO_LIBRARY_URL + currentVideo + ".mp4"); sampleSource = new FrameworkSampleSource(this, uri, null, 2); // 1. Instantiate the player. // 2. Construct renderers. videoRenderer = new MediaCodecVideoTrackRenderer(sampleSource, MediaCodec.VIDEO_SCALING_MODE_SCALE