All Projects → JeffMony → Mediasdk

JeffMony / Mediasdk

Licence: apache-2.0
The library is working for downloading video while playing the video, the video contains M3U8/MP4

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Mediasdk

Android P2p Engine
Let your viewers become your unlimitedly scalable CDN.
Stars: ✭ 70 (-57.32%)
Mutual labels:  m3u8, exoplayer, ijkplayer, hls
Ios P2p Engine
Let your viewers become your unlimitedly scalable CDN.
Stars: ✭ 31 (-81.1%)
Mutual labels:  m3u8, ijkplayer, hls
Sjmediacacheserver
A HTTP Media Caching Framework. It can cache FILE or HLS media. 音视频边播边缓存框架, 支持 HLS(m3u8) 和 FILE(mp4, mp3等).
Stars: ✭ 87 (-46.95%)
Mutual labels:  m3u8, mp4, hls
Starrysky
🔥A Powerful and Streamline MusicLibrary(一个丰富的音乐播放封装库,支持多种音频格式,完美解决你的问题。)
Stars: ✭ 1,022 (+523.17%)
Mutual labels:  m3u8, exoplayer, hls
Android-hls
最近公司产品需要,调研hls(m3u8) aes-128 解密播放 . 分析 51Cto, 慕课
Stars: ✭ 73 (-55.49%)
Mutual labels:  hls, m3u8, exoplayer
Magicalexoplayer
The Easiest Way To Play/Stream Video And Audio Using Google ExoPlayer In Your Android Application
Stars: ✭ 171 (+4.27%)
Mutual labels:  mp4, exoplayer, hls
Webxdownloader
Browser extension to download Webex meeting recordings
Stars: ✭ 52 (-68.29%)
Mutual labels:  m3u8, mp4, hls
p2p-cdn-sdk-android
Free p2p cdn android github sdk to reduce video streaming costs of live and on demand video using webrtc by upto 90% and improve scalability by 6x - 🚀 Vadootv 🚀
Stars: ✭ 39 (-76.22%)
Mutual labels:  hls, m3u8, exoplayer
Media Server
RTSP/RTP/RTMP/FLV/HLS/MPEG-TS/MPEG-PS/MPEG-DASH/MP4/fMP4/MKV/WebM
Stars: ✭ 1,363 (+731.1%)
Mutual labels:  m3u8, mp4, hls
Mediaelement
HTML5 <audio> or <video> player with support for MP4, WebM, and MP3 as well as HLS, Dash, YouTube, Facebook, SoundCloud and others with a common HTML5 MediaElement API, enabling a consistent UI in all browsers.
Stars: ✭ 7,767 (+4635.98%)
Mutual labels:  mp4, hls
Node Media Server
Node.js Media Server / VOD / HLS / DRM
Stars: ✭ 49 (-70.12%)
Mutual labels:  mp4, hls
M3u8
Python m3u8 Parser for HTTP Live Streaming (HLS) Transmissions
Stars: ✭ 1,064 (+548.78%)
Mutual labels:  m3u8, hls
Exoplayer 2 Example
Android example apps
Stars: ✭ 70 (-57.32%)
Mutual labels:  m3u8, exoplayer
M3u8
Parser and generator of M3U8-playlists for Apple HLS. Library for Go language. 🎦
Stars: ✭ 800 (+387.8%)
Mutual labels:  m3u8, hls
Ffmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
Stars: ✭ 27,382 (+16596.34%)
Mutual labels:  mp4, hls
Shinobi
☮️ 🇵🇸 Shinobi CE - The Free Open Source CCTV platform written in Node.JS (Camera Recorder - Security Surveillance Software - Restreamer
Stars: ✭ 1,099 (+570.12%)
Mutual labels:  mp4, hls
P2p Cdn Sdk Javascript
Free p2p cdn github javascript sdk to reduce video streaming costs of live and on demand video using webrtc by upto 90% and improve scalability by 6x - 🚀 Vadootv 🚀
Stars: ✭ 158 (-3.66%)
Mutual labels:  m3u8, hls
Mediaelement Files
Sample media files (MP4, WebM, Ogv, MP3, etc.) for the MediaElement.js library
Stars: ✭ 92 (-43.9%)
Mutual labels:  mp4, hls
Backoffice Administration
Stars: ✭ 89 (-45.73%)
Mutual labels:  m3u8, hls
Gpac
Modular Multimedia framework for packaging, streaming and playing your favorite content.
Stars: ✭ 1,321 (+705.49%)
Mutual labels:  mp4, hls

MediaSDK

The library is working for downloading video while playing the video, the video contains M3U8/MP4

Developer documentation is here, Click it

You can refer to the technical documentation:https://www.jianshu.com/p/27085da32a35

Use the library:

allprojects {
  repositories {
    ...
    maven { url 'https://jitpack.io' }
  }
}

dependencies {
        implementation 'com.github.JeffMony:MediaSDK:2.0.0'
}

The Core functions of the project

  • Cache management, LRU
  • Video downloading management
  • Local proxy management
  • Display downloading speed
  • Display the video cache's size
  • Support the video's downloading while playing the video, M3U8/MP4 video

The project's architecture is as follows:

Developer documentation

1.Application->onCreate(...)

File file = LocalProxyUtils.getVideoCacheDir(this);
if (!file.exists()) {
    file.mkdir();
}
LocalProxyConfig config = new VideoDownloadManager.Build(this)
    .setCacheRoot(file)
    .setUrlRedirect(false)
    .setTimeOut(DownloadConstants.READ_TIMEOUT, DownloadConstants.CONN_TIMEOUT, DownloadConstants.SOCKET_TIMEOUT)
    .setConcurrentCount(DownloadConstants.CONCURRENT_COUNT)
    .setIgnoreAllCertErrors(true)
    .buildConfig();
VideoDownloadManager.getInstance().initConfig(config);

1.setCacheRoot The cache path; 2.setUrlRedirect Support request's redirect; 3.setCacheSize Set cache size; 4.setTimeOut Set request's timeout; 5.setPort Set the local proxy server's port; 6.setIgnoreAllCertErrors Support the certificate;

2.The local proxy server's switch

PlayerAttributes attributes = new PlayerAttributes();
attributes.setUseLocalProxy(mUseLocalProxy);

3.Set the listener

mPlayer.setOnLocalProxyCacheListener(mOnLocalProxyCacheListener);
mPlayer.startLocalProxy(mUrl, null);

private IPlayer.OnLocalProxyCacheListener mOnLocalProxyCacheListener = new IPlayer.OnLocalProxyCacheListener() {
    @Override
    public void onCacheReady(IPlayer mp, String proxyUrl) {
        LogUtils.w("onCacheReady proxyUrl = " + proxyUrl);
        Uri uri = Uri.parse(proxyUrl);
        try {
            mPlayer.setDataSource(PlayerActivity.this, uri);
        } catch (IOException e) {
            e.printStackTrace();
            return;
        }
        mPlayer.setSurface(mSurface);
        mPlayer.setOnPreparedListener(mPreparedListener);
        mPlayer.setOnVideoSizeChangedListener(mVideoSizeChangeListener);
        mPlayer.prepareAsync();
    }

    @Override
    public void onCacheProgressChanged(IPlayer mp, int percent, long cachedSize) {
        LogUtils.w("onCacheProgressChanged percent = " + percent);
        mPercent = percent;
    }

    @Override
    public void onCacheSpeedChanged(String url, float cacheSpeed) {
        if (mPlayer != null && mPlayer.get() != null) {
            mPlayer.get().notifyProxyCacheSpeed(cacheSpeed);
        }
    }

    @Override
    public void onCacheFinished(String url) {
        LogUtils.i("onCacheFinished url="+url + ", player="+this);
        mIsCompleteCached = true;
    }

    @Override
    public void onCacheForbidden(String url) {
        LogUtils.w("onCacheForbidden url="+url+", player="+this);
        mUseLocalProxy = false;
        if (mPlayer != null && mPlayer.get() != null) {
            mPlayer.get().notifyProxyCacheForbidden(url);
        }
    }

    @Override
    public void onCacheFailed(String url, Exception e) {
        LogUtils.w("onCacheFailed , player="+this);
        pauseProxyCacheTask(PROXY_CACHE_EXCEPTION);
    }
};

demo:

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].