All Projects → hackereee → LineMediaPlayer

hackereee / LineMediaPlayer

Licence: other
本地代理服务器监听android mediaplayer播放请求,由本地进行重新封装转发请求,从而达到获取流媒体数据并缓存的功能。

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to LineMediaPlayer

skin.grid
Grid, a UI for Kodi. By using this code you agree with the license terms as included.
Stars: ✭ 39 (+116.67%)
Mutual labels:  mediaplayer
ChatVoicePlayer
An Android library to make the implementation of voice/audio messages' playing easier
Stars: ✭ 157 (+772.22%)
Mutual labels:  mediaplayer
Jade-Player
A media player for Android.
Stars: ✭ 70 (+288.89%)
Mutual labels:  mediaplayer
media
Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
Stars: ✭ 294 (+1533.33%)
Mutual labels:  mediaplayer
MusicPlayer
Android music player example.
Stars: ✭ 20 (+11.11%)
Mutual labels:  mediaplayer
HPlayer2
Modular Media Player for Raspberry Pi and more...
Stars: ✭ 28 (+55.56%)
Mutual labels:  mediaplayer
YetAnotherVideoPlayer
Yet Another Video Player for Andoid
Stars: ✭ 62 (+244.44%)
Mutual labels:  mediaplayer
android-jungle-mediaplayer
An Android MediaPlayer framework. Can play audio / video, or record audio.
Stars: ✭ 89 (+394.44%)
Mutual labels:  mediaplayer
Maple
Maple is a windows desktop application designed to support semi and non professional streamers in playing back local audio files and streaming content from the internet to their favorite playback device
Stars: ✭ 37 (+105.56%)
Mutual labels:  mediaplayer
android-audio-sensei
High-level library to make android audio recording and playing more simple by handling boring stuff like runtime permissions and by completely abstracting audio playback controller
Stars: ✭ 41 (+127.78%)
Mutual labels:  mediaplayer
HASS.Agent
Windows-based client for Home Assistant. Provides notifications, quick actions, commands, sensors and more.
Stars: ✭ 590 (+3177.78%)
Mutual labels:  mediaplayer
MusicPlayer
Play songs in Background with a set of user preferences available as a 'switch' in the cmdlet.
Stars: ✭ 16 (-11.11%)
Mutual labels:  mediaplayer
ad-alexatalkingclock
Alexa (or other Smart Speakers) tell you the time without asking every hour. Please ⭐️if you like my app :)
Stars: ✭ 30 (+66.67%)
Mutual labels:  mediaplayer
CommenPlayer
CommenPlayer ——Video player, Support ijkPlayer, Vlc, MediaPlayer, ExoPlayer; 视频播放器,支持ijkPlayer,Vlc,MediaPlayer,ExoPlayer
Stars: ✭ 81 (+350%)
Mutual labels:  mediaplayer
MQPlayer
Android video player based on FFmpeg and Exoplayer
Stars: ✭ 20 (+11.11%)
Mutual labels:  mediaplayer
MediaFlyout
Windows 10+ Media Control Taskbar Flyout
Stars: ✭ 87 (+383.33%)
Mutual labels:  mediaplayer
musicplayer
musicplayer 音乐播放器框架 简单易懂易扩展 已写了播放器demo和列表播放的demo兼容七牛等第三方Mediaplayer
Stars: ✭ 14 (-22.22%)
Mutual labels:  mediaplayer
KingPlayer
🎬 一个专注于 Android 视频播放器的基础库,无缝切换内核。(IjkPlayer、ExoPlayer、VlcPlayer、MediaPlayer)
Stars: ✭ 35 (+94.44%)
Mutual labels:  mediaplayer
youtube-playlist-player
Watch and edit YouTube playlists on the desktop.
Stars: ✭ 14 (-22.22%)
Mutual labels:  mediaplayer
HAudioPlayer
AVPlayer再封装,实现类网易云音乐播放动画效果
Stars: ✭ 15 (-16.67%)
Mutual labels:  mediaplayer

#一个简单的本地代理播放器


介绍

由于android原本的播放器MediaPlayer并不支持音视频缓存控制,而且MediaPlayer 中无法获取到流媒体数据,但是我恰好需要缓存这个流媒体到本地,并且第二次打开此媒体的时候直接读取缓存呢?所以这里我参考了网上的解决方案,使用ServerSocket 进行本地代理,播放的时候让播放器发起一个本地的媒体源获取,然后通过代理我们取到此client请求,并且重新组装以后发送远程服务器请求真正的流媒体数据,这时候我们就可以取到真正的数据并且进行缓存,以便第二次使用的时候直接读取缓存。 模拟的时候进行了302重定向处理,可以递归定向到真实的数据流地址。

使用方法

建议在Application 处使用此方法进行初始化,这里会初始化一个文件夹作为缓存路径: SocketProxyPlay.getInstance().init(this, true); 其中,第一个参数为上下文,第二个参数为是否开启本地监听,如果这里为false,那么在需要使用的时候需要调用SocketProxyPlay.getInstance().listening()方进行监听开启,此方法建议和close()方进行对应使用,一般在Activity的onCreate 开启监听, 在 onDestory 进行close关闭监听。

如果在Android 6.0 之上操作系统中,使用sd权限,需要进行权限申请,建议开启一个过渡的Activity(比如欢迎页)进行权限申请,申请结束后在申请结束的回调onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults)里使用 SocketProxyPlay.getInstance().createDefaultSavePath(Context context)方法进行再次的缓存路径确认,以确保路径真的是sd卡路径,以免占用太多手机存储空间。

具体可以参考DemoActivity 里的写法进行使用。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].