Native Media Player for Android & iOS
how to start
1. If you are using StreamingAssets, create a new folder named ‘StreamingAssets’ under Assets. Put your media sources in this folder.
2. Import NativeMediaPlayer prefab to your scene.
3. Configure NMPSettings, MediaEventListener, AndroidSettings, iOSSettings attached to the prefab using the inspector.
4. Import MediaSource prefab to your scene.
5. Import necessary media source prefabs (Playlist or MediaItem) to your scene and attach them to the MediaSource. Configure media items using the inspector of the prefabs.
6. When adding an album art image, click the texture and check ‘Read/Write Enabled’ under Advanced in the inspector.
7. Set the MediaSource to NMPSettings's Media Source under Core Components.
C# Scripts with Custom Inspector
NMPSettings.cs
Automates general configurations and default settings for NativeMediaPlayer, which is a bridge class that controls the native APIs.
💡 Included in NativeMediaPlayer.prefab
See this page for the details
https://codeqo.tistory.com/category/Native%20Media%20Player/NativeMediaPlayer
MediaEventListener.cs
Listens to the playback events from the native side and invokes callback events.
💡 Included in NativeMediaPlayer.prefab
See this page for the details
https://codeqo.tistory.com/category/Native%20Media%20Player/MediaEventListener
AndroidSettings.cs
Manages Android native settings.
💡 Included in NativeMediaPlayer.prefab
See this page for the details
https://codeqo.tistory.com/category/Native%20Media%20Player/Android
iOSSettings.cs
Manages iOS native settings.
💡 Included in NativeMediaPlayer.prefab
See this page for the details
https://codeqo.tistory.com/category/Native%20Media%20Player/iOS
Playlist.cs
The playlist is implemented by all NativeMediaPlayer implementations. It enables sequential playback of multiple media items.
💡 public static class NativeMediaController is an extender class for Playlist management. This simplifies the implementation of multiple playlists.
💡 Included in Playlist.prefab
See this page for the details
https://codeqo.tistory.com/category/Native%20Media%20Player/Playlist
MediaSource.cs
A required script for NMPSettings.cs as a default media source. It offers 3 different media types.
- A MediaItem
- A Playlist
- Multiple Playlists
💡 Included in MediaSource.prefab