Comments (21)
ExoPlayer doesn't follow cross-protocol redirects by default.
Enable cross-protocol redirects:
DefaultHttpDataSourceFactory httpDataSourceFactory =
new DefaultHttpDataSourceFactory(
Util.getUserAgent(context, context.getPackageName()),
null,
DefaultHttpDataSource.DEFAULT_CONNECT_TIMEOUT_MILLIS,
DefaultHttpDataSource.DEFAULT_READ_TIMEOUT_MILLIS,
true/*allowCrossProtocolRedirects*/);
DefaultDataSourceFactory dataSourceFactory = new DefaultDataSourceFactory(
context, httpDataSourceFactory);
Play m3u8
media:
- add dependency:
exoplayer-dls
implementation 'com.google.android.exoplayer:exoplayer-hls:2.11.7'
- create a
HlsMediaSource.Factory
instance:
public class MyFactory extends PlayerService.ComponentFactory {
HlsMediaSource.Factory mHlsMediaSourceFactory;
@Override
public void init(Context context) {
...
mHlsMediaSourceFactory = new HlsMediaSource.Factory(dataSourceFactory);
}
...
}
- use
HlsMediaSource.Factory
instance create aExoMusicPlayer
:
@Inject
@NonNull
@Override
public MusicPlayer createMusicPlayer(Context context) {
return new ExoMusicPlayer(context, mHlsMediaSourceFactory);
}
from snow.
ok you can add it in your SNAPSHOT? we are waiting for further testing
from snow.
This repository has added support for jitpack
, you can built it yourself: https://jitpack.io/#jrfeng/snow
from snow.
i Dont know why ..
implementation 'com.github.jrfeng.snow:player:master-651f631386-1'
`Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve
com.github.jrfeng.snow:player:master-651f631386-1.`
from snow.
from snow.
Have you tried this: https://github.com/jitpack/jitpack.io/issues/3758#issuecomment-630306373
from snow.
Yes its not work
maven { url 'https://www.jitpack.io' }
and
implementation 'com.github.jrfeng.snow:player:master-651f631386-1'
error:
`Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve
com.github.jrfeng.snow:player:master-651f631386-1.`
Pls check
"make the library readable to everyone."
from snow.
OK, I'll publish a new release, you can try it again.
from snow.
using implementation 'com.github.jrfeng.snow:player:1.0-alpha5'
after invalided /cache /restarted
Same issue Old Api version 18
ur: https://vidhttps.r.worldssl.net/thanthi-origin/liveabr/playlist.m3u8
`09-01 11:23:28.494 2306-2306/com.example.snowtest E/TAG: onConnected: true
09-01 11:23:42.025 2306-2318/com.example.snowtest E/MediaPlayer: error (1, -1004)
09-01 11:23:42.025 2306-2306/com.example.snowtest E/MediaPlayer: Error (1,-1004)
09-01 11:23:42.025 2306-2306/com.example.snowtest E/MediaMusicPlayer: MediaPlayer Error[what: 1, extra: -1004]
09-01 11:23:42.025 2306-2306/com.example.snowtest E/MusicPlayer: errorCode:5`
Same url working fine with api 29 emulator
Same issue Old Api version 20
url : http://playerservices.streamtheworld.com/api/livestream-redirect/HARRISJAYARAJ_S01.aac
Not no sound nio error (Not work)
Working fine Api version 18 emulator
Also no notification icon api level 18..
notification icon showing working fine api level29
from snow.
@webwayscript OK, I'll check it out.
from snow.
This doesn't seem to be a bug in this project.
Maybe you can check this StackOverflow post: https://stackoverflow.com/a/51285550/4768512
from snow.
yes .. this is the problem.. I think we need fix inside our app or your project library?
ok i will check it inside my app
from snow.
No its not work .. also not work all m3u8 in old apimlevel 18
another url : http://airlsmp6-lh.akamaihd.net/i/AIRLSMP134_1@369210/master.m3u8
also i try with
oncreat ;
`try {
ProviderInstaller.installIfNeeded(getApplicationContext());
SSLContext sslContext;
sslContext = SSLContext.getInstance("TLSv1.2");
sslContext.init(null, null, null);
sslContext.createSSLEngine();
} catch (GooglePlayServicesRepairableException | GooglePlayServicesNotAvailableException
| NoSuchAlgorithmException | KeyManagementException e) {
e.printStackTrace();
}`
implementation 'com.google.android.gms:play-services-auth:18.1.0'
not work m3u8 in old api level
from snow.
I received following error when i use your GitHub project
Ex url": http://airlsmp6-lh.akamaihd.net/i/AIRLSMP134_1@369210/master.m3u8
`snow.player.debug E/ExoMusicPlayer: com.google.android.exoplayer2.ExoPlaybackException:
com.google.android.exoplayer2.source.UnrecognizedInputFormatException: None of the available extractors
(MatroskaExtractor, FragmentedMp4Extractor, Mp4Extractor, Mp3Extractor, AdtsExtractor, Ac3Extractor, TsExtractor,
FlvExtractor, OggExtractor, PsExtractor, WavExtractor, AmrExtractor, Ac4Extractor, FlacExtractor) could read the stream.`
from snow.
Maybe you should check your audio source. This is not a bug in this project, I can't help for this, sorry.
from snow.
https://github.com/jrfeng/snow/blob/master/exo/src/main/java/snow/player/exo/ExoMusicPlayer.java
there is no HlsMediaSourceFactory ...
from snow.
http://airlsmp6-lh.akamaihd.net/i/AIRLSMP134_1@369210/master.m3u8
this source very popular and no 1 audio video source from akamaihd.net...
from snow.
https://github.com/jrfeng/snow/blob/master/exo/src/main/java/snow/player/exo/ExoMusicPlayer.java
there is no HlsMediaSourceFactory ...
Maybe you should learn how to use ExoPlayer
? Don't mind, I'll create a helper to simplify this operation.
from snow.
i use like this all urls working fine.
`private OkHttpDataSourceFactory dataSourceFactory;
private SimpleExoPlayer exoPlayer;
onCreate
OkHttpClient okHttpClient;
okHttpClient = new OkHttpClient.Builder()
.connectTimeout(10, TimeUnit.SECONDS)
.writeTimeout(10, TimeUnit.SECONDS)
.readTimeout(10, TimeUnit.SECONDS)
.build();
exoPlayer = new SimpleExoPlayer.Builder(context).build();
dataSourceFactory = new OkHttpDataSourceFactory(okHttpClient, Util.getUserAgent(context, useragent));
private void prepareToPlay(Uri uri) {
if( String.valueOf(uri).contains("m3u8") ) {
MediaSource videoSource = new HlsMediaSource.Factory(dataSourceFactory).createMediaSource(uri);
exoPlayer.prepare(videoSource);
}else{
MediaSource videoSource = new ProgressiveMediaSource.Factory(dataSourceFactory).createMediaSource(uri);
exoPlayer.prepare(videoSource);
}
}`
This code all m3u8 with or with https working fine .. and also all redirected working fine.. its working fine from api level 16 up to latest version.. I dont know why its not working with your library
Just now i found you using more code in MyFactory.java.. May be okhttp fix all https problem ..
from snow.
@webwayscript Thanks for feedback, I'll check it carefully.
from snow.
@webwayscript Can you provide some url of m3u8
media? If it's private, you can send it to my email: [email protected]
from snow.
Related Issues (20)
- “"音量均衡”功能和修改”随机播放“算法 HOT 10
- AppWidget 怎么接收不到广播啊? HOT 12
- MIUI14上通知栏专辑封面显示问题 HOT 6
- setNextPlay()添加下一首播放有问题。 HOT 3
- qq音乐的播放链接不能播放,用浏览器直接打开是没问题的 HOT 1
- Android 13 黑屏音乐过一会就会停止播放 HOT 15
- 寻求一下帮助。 HOT 9
- 没有设置播放音量大小的方法吗 HOT 6
- 1.2.11 多次点击播放暂停会出现无声音播放 HOT 3
- 可以出蓝牙车载歌词功能吗 HOT 3
- Need Update Library HOT 4
- Media Notification Not closed HOT 2
- Android 14 Error: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts HOT 3
- Namespace not specified. Specify a namespace in the module's build file
- *Important proguard Issue HOT 3
- 设置音量暂停恢复播放后音量设定值会失效啊 HOT 3
- 引入之后,MMKV版本冲突,如何解决 HOT 3
- 音乐进度监听器除了DataBinding,支持传统的回调监听方式吗? HOT 3
- 点击系统音乐通知栏不能跳转到播放界面 HOT 4
- How PlayerClient get all other class? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snow.