iOS

Native Media Player has a full Apple iOS supports. You will have a full control of iOS's background music controls.

iOS Settings

iOSSettings.cs is a MonoBehavior class containing necessary configurations for Native Media Player iOS device supports.

Post Process Build

PostProcessBuild.cs located in Codeqo/Editor/NativeMediaPlayer/ is a very crucial to this plugin, please leave this script if you are getting rid of unnecessary files. This script automatically adds MediaPlayer framework and -ObjC build property to your iOS build configurations.

public class MediaStyleNotificationPostProcessBuild
{
#if UNITY_IOS
    [PostProcessBuildAttribute(1)]
    public static void OnPostProcessBuild(BuildTarget buildTarget, string path)
    {
        if (buildTarget == BuildTarget.iOS)
        {
            var exportPath = new DirectoryInfo(path).FullName;
            var projectPath = new DirectoryInfo(
                Path.Combine(Path.Combine(exportPath, "Unity-iPhone.xcodeproj"), "project.pbxproj")).FullName;

            var project = new PBXProject();
            project.ReadFromFile(projectPath);
            var frameworks = project.TargetGuidByName("UnityFramework");

            project.AddFrameworkToProject(frameworks, "MediaPlayer.framework", false);
            project.AddBuildProperty(frameworks, "OTHER_LDFLAGS", "-ObjC");
            project.WriteToFile(projectPath);
        }
    }
#endif    

Last updated