Native Media Player
Glitch9 Inc.Main Docs.
  • Introduction
    • Native Media Player
    • Preparation
    • Initialization
  • Functionalities
    • Media Item
    • Media Metadata
    • Playlist
    • Media Events
    • UI Components
    • Android Settings
    • iOS Settings
  • Advanced
    • Manual Initialization
    • Creating Playlist at Runtime
    • Single Media Item Playlists
  • API Reference
    • MediaPlayer
      • Properties
      • Methods
    • MediaEvents
    • MediaItem
    • MediaMetadata
    • Playlist
    • Configuration Details
  • Support
    • FAQ
    • Troubleshooting
      • SeekTo (Seekbar) doesn't work
      • java.lang.NoClassDefFoundError
      • One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified
      • AndroidX Build Error: resource android:attr/lStar not found.
    • Update Logs
Powered by GitBook
On this page
  • 1. Install Newtonsoft.Json
  • 2. Configure Settings
  • 3. Add NativeMediaPlayer prefab to your scene
  • 4. Create StreamingAssets folder
  • 6. Add track information
  • 7. Add album arts
  1. Introduction

Preparation

It takes less than 10 minutes to import Native Media Player to your project. Here's a step by step guide to jump in.

PreviousNative Media PlayerNextInitialization

Last updated 11 months ago

1. Install Newtonsoft.Json

Native Media Player utilizes Newtonsoft.Json for efficient JSON manipulation, which is essential for communicating with native plugins. Unity Package Manager (UPM) provides a streamlined method for managing package dependencies. Follow the step by step guide below to install Newtonsoft.Json via UPM:

2. Configure Settings

In Unity, go to Edit > Preferences (or Unity > Preferences on macOS), then navigate to Glitch9 > Native Media Player to access the settings.

3. Add NativeMediaPlayer prefab to your scene

Import NativeMediaPlayer.prefab to your scene. It's located under Glitch9\NativePlugins\NativeMediaPlayer\Prefabs.

4. Create StreamingAssets folder

If you are using local audio files, create a new folder named ‘StreamingAssets’ under Assets. Put your audio files under this folder. You can skip this part if you are only using remote URLs.

6. Add track information

Import a Playlist prefab, multiple Playlist prefabs or a MediaItem prefab to your scene and attach them to the MediaSource. Configure track information(s) on the prefab's Editor Inspector.

7. Add album arts

When adding an album art image, click the texture and check ‘Read/Write Enabled’ under Advanced in the inspector.

If you are having trouble showing the album art, try changing compression format of the image. ASTC compression formats are not supported.

Check Read/Write Enabled
Configuration Details
How to setup Newtonsoft.Json | Glitch9 Documentation
Logo
Enter track information to Playlist.prefab or MediaItem.prefab