Search Unity

MediaPlayer8 - all-purpose, streaming & caching support

Discussion in 'Assets and Asset Store' started by xucian, Mar 27, 2017.

?

What's the next platform you'd like us to support?

  1. Windows PC

    56.3%
  2. iOS

    40.6%
  3. Windows Phone

    3.1%
  1. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Hi fellows.
    We're really excited to announce our complete media player solution (currently, only available for android) with render to texture capabilities!
    Supports all popular formats both for local playback and for streaming (DASH, HLS, SmoothStreaming, Progressive streaming, RTMP), audio/video.
    For android, the core is based on ExoPlayer (so anything ExoPlayer can do, MediaPlayer8 for Android also can).

    Usual functionalities like setting the volume, seeking, pausing are fully supported. Unusual functionalities are also included, like "GetBufferLevel01RelativeToDuration()". :)

    We're working on including more platforms (iOS, Windows).

    Android watermarked demo APK (v1.3): Link
    Free watermarked asset for testing (v1.3): Link
    YouTube demo (v1.0): Link
    (turn your volume to half if you value your ears)
    Asset store: Link



    UPDATE 28.08.2019 - v1.3:
    • Android: Added ARM64 support (at least Unity 2017.4.16 needed)
    • Android: Minimum API version raised to API 21 (Android 5.0 Lollipop)
    • Android: Fixed major bug in native lib leading to crash on some Mali GPUs

    UPDATE 02.01.2018 - v1.1:
    • Added possibility to manually enter an URL in any of the scenes
    • Android:
    • Updated exoplayer version to 2.6.0 (latest)
    • RTMP support
    • Cleaned the native project which the jar libs are based on and removed some unnecessary logs


    Roadmap:
    Soon, we'll create an upgrade pack that will translate thousands of lines of code (already-existing) into what we call "Adaptive Cache":
    Basically, you'd be able to stream H.264 content without any interruptions.
    The "adaptive" part takes care of disk+ram caching & network speed predictions so after the initial waiting time, the video will play without any re-buffering (given there is enough disk and/or ram available). No disk or ram resources are used beyond those needed to achieve no interruptions.
    Another feature of the "adaptive" upgrade is fragmented caching: nothing is wasted; if you re-wind, the content is played from disk (there is a limit for disk cache's size, of course)

    Known issues:
    - [Android] Not compatible with Unity 2018.2.0 to 2018.2.7 due this bug in Unity. Solution: update to at least Unity 2018.2.8
     
    Last edited: Aug 28, 2019
  2. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    MP8 is live! :)
     
    Last edited: Dec 19, 2017
  3. nOsmircK

    nOsmircK

    Joined:
    Mar 18, 2014
    Posts:
    8
    Hello! Is there any possibility to open source this plugin? I need to extend its functionality to play secured widevine (online and offline) plus also open a new activity on top of Unity with the player in full screen.

    If opening this is not a possibility, at least can I request this features?

    Thanks!
     
  4. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Hi. Sorry, no plans to open source the native part.
    As for the full-screen playback, remember that MP8 is rendering to a texture, so you can put/use it wherever you need it, including in a call to GUI.Texture2D() with full-screen dimensions or in a UnityEngine.UI.RawTexture component added to a screen-space canvas and maximized to full-screen.
    I know there are some commands lacking for playing drm content, and we'll address this in the future, though I don't know exactly when.

    Lucian
     
    Last edited: May 10, 2017
  5. Dhaval1992

    Dhaval1992

    Joined:
    Apr 18, 2017
    Posts:
    8
    When we can expect the iOS support....?
    If you you make the iOS support for this than it will be really good...!!!!
     
  6. nOsmircK

    nOsmircK

    Joined:
    Mar 18, 2014
    Posts:
    8
    Hi Lucian, thanks for your reply!

    The main reason for the native full screen playback in a separated activity is because it saves battery. Having Unity to render the video, even if it's just a Quad or a Canvas or anything, it will be much more efficient to use a complete separate Android activity with the native player in full screen which will use the needed resources and will have much better and smoother playback with less resources reducing battery consumption.
     
  7. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    I see. I wish I could help you with that. Hope you find a way whether using MP8 or something else :thumbsup:

    Lucian
     
  8. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Hi there.
    It remains an open question for now. We didn't start the iOS implementation yet.
    Subscribe to this thread to receive updates :)

    Best
     
  9. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Update: MediaPlayer8 is now 20$
     
    Last edited: Dec 19, 2017
  10. Pode

    Pode

    Joined:
    Nov 13, 2013
    Posts:
    145
    @thefallengamesstudio : I saw that ExoPlayer 2.3 support playing ambisonic audio files. On which version of Exoplayer is your asset based ?
     
  11. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Hi there.
    The ExoPlayer version used is 2.0.4.
    Already planning for an to update, but can't say when it'll be exactly. Anyway, the feature you request may or may not be present in the next update. Time will tell
     
  12. CastryGames

    CastryGames

    Joined:
    Oct 1, 2014
    Posts:
    77
    How can I extract the text of the subtitles? please help
     
  13. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Hi, it's not supported yet. We'll add it on the to-do list for the next release
     
  14. CastryGames

    CastryGames

    Joined:
    Oct 1, 2014
    Posts:
    77
    make a system for reading subtitle in srt, if you are interested, I can give you
     
  15. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Hi. Currently, the development is paused for ~1 month, but I'll be glad to integrate your change. Shoot me an email
     
  16. joserrodrigues

    joserrodrigues

    Joined:
    Jan 23, 2013
    Posts:
    1
    Hi,
    Is It works on Unity 2017?

    Thanks
     
  17. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Hi, Yes. Just tested it now and there are no problems :)
     
  18. FlashWB

    FlashWB

    Joined:
    Dec 6, 2017
    Posts:
    2
    Hi,
    does it have rtmp playback support on Android as well?
     
  19. ocxxt27EhzkhaHUZ5yMuJw

    ocxxt27EhzkhaHUZ5yMuJw

    Joined:
    Nov 23, 2017
    Posts:
    1
    FlashWB likes this.
  20. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Hi,
    We've started today to integrate the RTMP extension and will post here again when it's done
     
  21. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Confirmed. For android, RTMP will be available in the next release (should arrive in 1-2 weeks), along with the latest exo player release
     
  22. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    v1.1 is live now with RTMP support :)
     
  23. Oniwabansu

    Oniwabansu

    Joined:
    Oct 18, 2016
    Posts:
    3
    Hello @thefallengamesstudio

    I was wondering if the asset as it is currently supports DRM encoding using widevine or if it doesn't if there is a plan in place to support it in the near future?
    So far it is looking good and seems simple enough to integrate.
     
  24. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Hi, we're already looking into it. Until now, it seems like only some of the Mali-based devices work with it, and Andreno-based are all fine. Can't promise anything, but this topic will be updated as soon as we see progress
     
    Oniwabansu likes this.
  25. Oniwabansu

    Oniwabansu

    Joined:
    Oct 18, 2016
    Posts:
    3
    Sounds good that you are already working on it and we look forward to hearing about updates about DRM when it is implemented. Quite unfortunate that DRM isn't already implemented in the asset as we purchased it based on the statement that "anything exoplayer can do, MediaPlayer8 for android can do".
     
  26. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Sorry if that statement mislead you. Will change it to "so anything ExoPlayer can do, MediaPlayer8 for android also can - missing features can be implemented upon request, for free"

    We're adapting it basing on the features that our users request, so if exo can do something and someone requests it, we'll try to implement it. Exo is too complex for us to implement all of the possible features at once, and even if we do, there's a big chance most of them won't be used too often if at all.
    You can ask for a refund and buy it again when you see us post the updates about the drm feature and it's implemented.


    Regards,
    George
     
  27. Oniwabansu

    Oniwabansu

    Joined:
    Oct 18, 2016
    Posts:
    3
    That's a very good answer, completely understand that not everything will be implemented at once and needs to be done on a per request basis. Although the player didn't have that exact feature that we were looking for it still seems to be very useful and we are happy to continue using it knowing that you are working on DRM compatibility.
     
  28. DoPie

    DoPie

    Joined:
    Jun 20, 2013
    Posts:
    64
    Hi i got several Errol here how i can fix it?

    Capture 33.PNG
     
  29. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Hi,

    Several errors usually boil down to only one error, the first.
    I see you've tried to run in in editor, which is not supported. There's no windows/mac support at the moment - this is done through native plugins and we only created the one for android. Our first priority is to enable playback in editor, but we don't have any ETA.

    You can see in the feature image on the asset store that the only supported platform is android, at this moment.
    Is android your target platform or windows/mac? In the second case, the asset is not useful for you, not at the current stage of development
     
  30. DoPie

    DoPie

    Joined:
    Jun 20, 2013
    Posts:
    64
    Oh i see thanks ^_^
     
  31. DoPie

    DoPie

    Joined:
    Jun 20, 2013
    Posts:
    64
    Next BIG Question how i can Play Stream Videos with DRM Protected?? :rolleyes::)
     
  32. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    ATM, there's no advancement in the DRM feature. We tried for a few days to implement it, but there are too many dependencies on the gpu's architecture. Mali acts different than adreno, for different android versions. It's too hard to test and the time invested isn't worth it for us, not at the moment. We'll come back to it, but no fixed date for that
     
  33. djmario

    djmario

    Joined:
    Feb 17, 2017
    Posts:
    4
    I have checked demo package and want to try use this with RTMP

    For example this link [rtmp://184.72.239.149/vod/mp4:bigbuckbunny_450.mp4]

    But it can not work, please help to how I can setup with RTMP cause I read and consider to buy but can not test

    Many thanks
     
  34. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Hi,

    We've just added a link to an Android demo APK for v1.1, which has the RTMP support and there's also the possibility to load your own links :)

    Have a nice day
     
  35. aknahata

    aknahata

    Joined:
    Jan 24, 2017
    Posts:
    1
    Hi, I am considering this plugin. Can you send me sample code or point me to the right direction to render 360 content using this player? Thanks
     
  36. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Hi. Because you can render to any texture with this plugin,everything boils down to just having an inside-out sphere model. Everything else is inside example scenes in the package.

    Some guidance is here: https://unity3d.college/2017/04/24/360-video-in-unity-5-6/
     
  37. tear3333

    tear3333

    Joined:
    Jun 5, 2018
    Posts:
    10
    Hi, I am considering this plugin.can i play rtmp live steaming? use in AR 360 play video ?
    Low delay

    。 Thanks
     
  38. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Hey, yes we support RTMP :)

    Edit: The texture the video is drawn to can be used like any regular texture, so yes you can just apply it to an "inside-out sphere" and it'll work
     
  39. tear3333

    tear3333

    Joined:
    Jun 5, 2018
    Posts:
    10
    protected virtual void Awake()
    {
    _ControllerProxy = CreateControllerProxy();
    _MediaSurfaceInit();
    if (!Rendering.targetTexture)
    {
    Rendering.targetTexture =
    Texture2D.CreateExternalTexture(
    _TextureWidth,
    _TextureHeight,
    TextureFormat.RGBA32,
    true,
    false,
    IntPtr.Zero
    );
    // Only use this gameObject's renderer if no target texture is specified via inspector
    if (!Rendering.targetRenderer)
    Rendering.targetRenderer = GetComponent<Renderer>();
    }
    Rendering.MaybeChangeRendererTexture();
    IssuePluginEvent(MediaSurfaceEventType.Initialize);
    }



    why _ControllerProxy = null ? I didn't use the code to change the code ,use play scence AdaptiveCacheExample
     

    Attached Files:

  40. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Try creating a new project and re-importing the asset there. That DLL from the exception should exist.
    Also note that since the only supported platform ATM is android (as shown in the promo image), you can't play it directly in the editor (since it uses native libraries)
     
  41. tear3333

    tear3333

    Joined:
    Jun 5, 2018
    Posts:
    10
    Can your send my email new projects ?
    Thanks, i had try. 369406145@qq.com
     
  42. tear3333

    tear3333

    Joined:
    Jun 5, 2018
    Posts:
    10
    Can your send my email new projects ?
    Thanks, i had try. 369406145@qq.com
     
  43. tear3333

    tear3333

    Joined:
    Jun 5, 2018
    Posts:
    10
    play in PICO VR, ARE YOU OK?
     
  44. tear3333

    tear3333

    Joined:
    Jun 5, 2018
    Posts:
    10
    CommandInvokationFailure: Unable to merge android manifests. See the Console for more details.
    D:\Java\jdk1.8.0_77\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:\Users\LIUYI\AppData\Local\Android\Sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
    stderr[
    Error: [Temp\StagingArea\AndroidManifest-main.xml:12, E:\vr\rtmpTest1\Temp\StagingArea\android-libraries\exoplayerforunity-release\AndroidManifest.xml:3] Main manifest has <uses-sdk android:minSdkVersion='16'> but library uses minSdkVersion='18'
    ]
    stdout[
    ]
    exit code: 1
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
    UnityEditor.HostView:OnGUI()
     
  45. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    We don't have a stable new version, so I meant that you need to re-download it in a new project and test its functionality (it'll work).

    This line "Main manifest has <uses-sdk android:minSdkVersion='16'> but library uses minSdkVersion='18'" tells you you need to set the android's min sdk version to 18 in player settings

    Please send your future questions to one of our support emails to prevent the thread from being bloated with one subject

    Best,
    George
     
  46. vikaskalpnik

    vikaskalpnik

    Joined:
    Nov 30, 2017
    Posts:
    5
    Hey, we just started using MediaPlayer8 and are quite happy with how simple it is.
    But we've hit an issue. We use it to play HLS streams. If the url ends with .m3u8, the video plays fine. But if the url has query params (*.m3u8?DVR), it doesn't play. Upon looking at logs, we get the following error.
    ExoPlayerImplInternal: Source error
    com.google.android.exoplayer2.source.UnrecognizedInputFormatException: None of the available extractors (MatroskaExtractor, FragmentedMp4Extractor, Mp4Extractor, Mp3Extractor, AdtsExtractor, Ac3Extractor, TsExtractor, FlvExtractor, OggExtractor, PsExtractor, WavExtractor, FlacExtractor) could read the stream.

    Upon debugging a little bit, I suspect if the url doesn't end with .m3u8, MP8 is creating ExtractorMediaSource rather than HlsMediaSource. But I could not find the code where the media source is initialized. Could you please let us know how to fix this? Thanks
     
  47. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    Hi,

    Just pass it the url without the query params after you parsed them (in case you need them). Should be simple, as it's just a string operation.

    Is this an acceptable solution?
     
  48. vikaskalpnik

    vikaskalpnik

    Joined:
    Nov 30, 2017
    Posts:
    5
    We use wowza and the url needs to have the query param (?DVR) in order to get DVR stream. So, we need to send the url with query params to our streaming server.
     
  49. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    I'll give you a new android plugin which allows urls with queries (this will also be included in the next official version) :)
    Write an email to lucian@thefallengames.com with your invoice number please
     
  50. vikaskalpnik

    vikaskalpnik

    Joined:
    Nov 30, 2017
    Posts:
    5
    Sounds great! Thank you for the quick responses. Sent you an email.