Skip to content

Novage/p2p-media-loader-mobile

Repository files navigation

P2P Media Loader Mobile

Platform: Android Kotlin JitPack Build Status

A Kotlin library for peer-to-peer media loading, designed to enhance streaming performance and reduce server load. Seamlessly integrate P2PML into your Android application with minimal setup.

Features

  • Efficient P2P content sharing for HLS
  • Simple integration and configuration
  • Improved streaming performance with reduced server bandwidth usage

Getting Started

Step 1: Add JitPack to Your Project

To include the P2P Media Loader Mobile library, first, configure dependencyResolutionManagement in your settings.gradle file:

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven(url = "https://jitpack.io")
    }
}

Step 2: Add the Library Dependency

Add the following implementation line to your build.gradle (app module):

implementation("com.github.Novage:p2p-media-loader-mobile:main-d71e8e4552-1")

Step 3: Configure the AndroidManifest

Ensure that your app has the necessary permissions and configurations by updating the AndroidManifest.xml file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools">

    <!-- Add internet access permission -->
    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:networkSecurityConfig="@xml/network_security_config"
        ... >
        ...
    </application>
</manifest>

Step 4: Allow Localhost Connections

Create or update the res/xml/network_security_config.xml file to allow localhost connections:

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">127.0.0.1</domain>
    </domain-config>
</network-security-config>

Make sure to reference this file in the <application> tag of your AndroidManifest.xml.


Usage

Once you've completed the setup, P2P Media Loader is ready to use in your application!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published