Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by daro1nsan3 · Mar 20, 2015 at 03:14 PM · apkmovietexturestreamingassetsobb

Android Split APK-OBB and StreamingAssets

Hi Guys!

Here is my S.O.S. call:

I have an app that I made for a Tourism manager, so basically is a 360° Video Player which have 4 scenes:

– Splashscreen scene with my company name on it (this just last 5 seconds)

– A menu scene where you can pick a 2d or 3d scene

– the 2d scene

– the 3d scene (stereoscopic view)

So I’m using the EasyMovieTexture asset to put my 360 video on a sphere and everything runs perfect in the full apk (230mb) when I install it on the test phone (samsung s5). Off course my .mp4 file is in the StremingAssets folder and there´s no problem with the playback.

The BIG PROBLEM comes when I upload the app to the Google playstore. I just did it throught the regular way:

– Using the Split Application Binary

– Uploading the apk (17mb)

– Then uploading the obb (213mb) which name is changed automatically by the playstore to “main.x.x.x.obb”

Now, when the app is downloaded throught the playstore both files are downloaded (I can see the .obb file in the /Android/obb/com.x.x/ folder) but the thing is that it seems that the app is loading it from another location because there is no video playback. However the scene that contains the video is loaded. So, I think that there is an issue with the reading of the .mp4 file wich is in the streamingassets folder, but I can’t make the EasyMovieTexture to look at the OBB file.

Here is a script made by Jon Martin wich is trying to fix this issue by correcting the path where the MoviePlayerCtrl has to look for the movie file

 public string CorrectMoviePath(string filename) {
     if (Application.dataPath.Contains(".obb")) {
         filename = Application.persistentDataPath + "/" + filename
     } else {
         filename = Application.streamingAssetsPath + "/" + filename
     }
     return filename;
 }


So now my question is, Where do I have to put this to make this work. I now is in the MoviePLayerCtrl script but it is too large and by just put it in there doest fix the problem and when I try to add the movie file name into the script Unity shows an error saying that the value doesnt exist.

Any help would be awesome!

Thnks in advance!

Regards from Chile!

Comment
Add comment · Show 7
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image filmcafe · May 19, 2015 at 06:27 AM 0
Share

Hi! I'm having the exact same issue. Have you made any progress with this?

Thanks!

Steve

avatar image wywarren · May 20, 2015 at 01:40 PM 0
Share

Hi I'm running into this problem right now. Everything was working before but after I added Prime31's Google Play Store kit and implemented my IAP it stopped working. So far I've narrowed it down to the following.

  • If I don't split application binary. It loads the video from jar:file:///data/app/com.company.appname.apk!/assets

  • If I split the application binary, it tries to load from jar:file:///storage/emulated/0/Android/obb/com.company.appname /main.version.com.company.appname.obb!/assets

Without splitting the binary, the videos load fine but splitting it seems to break the link. I've read in some places that it is the result of mixing javascript and C# but as far as I can tell the files in my source are all C#. I will try to update if I make any meaningful progress

avatar image wywarren · May 20, 2015 at 07:02 PM 0
Share

Hi I'm running into this problem right now. Everything was working before but after I added Prime31's Google Play Store kit and implemented my IAP it stopped working. So far I've narrowed it down to the following.

  • If I don't split application binary. It loads the video from jar:file:///data/app/com.company.appname.apk!/assets

  • If I split the application binary, it tries to load from jar:file:///storage/emulated/0/Android/obb/com.company.appname /main.version.com.company.appname.obb!/assets

Without splitting the binary, the videos load fine but splitting it seems to break the link. I've read in some places that it is the result of mixing javascript and C# but as far as I can tell the files in my source are all C#. I will try to update if I make any meaningful progress

avatar image stultitia1 · Sep 14, 2016 at 12:41 AM 0
Share

Hola @daro1nsan3 , aprovecho que eres de chile para preguntarte en español jeje. pudiste solucionar el problema con los videos? me sería de mucha ayuda. Ando revisando ya varios días y no logro hacer que funcione, los modelos 3d los carga normal, pero no logro hacer que funcione los videos. Gracias

avatar image SirLaur · Dec 14, 2017 at 11:51 AM 0
Share

Hey, sorry for bumping such an old thread, but did you find any solution ?

avatar image wywarren SirLaur · Dec 14, 2017 at 02:34 PM 1
Share

I’ve moved onto using U$$anonymous$$P or the new unity video player. Both work better in unity 2017.2

avatar image SirLaur wywarren · Dec 15, 2017 at 09:56 AM 0
Share

Hello and thank you for the fast answer. How exactly do you use the new video player ? What i do is create a VideoPlayer named videoPlayer, set videoPlayer.url to the path of the video and then use videoPlayer.Prepare(). When it's done I use videoPlayer.Play() and it plays the video(only on PC and apk-only builds, I still didn't manage to find the path to the video in the obb or what to do). Thanks a lot.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by wywarren · May 20, 2015 at 02:15 PM

I think I've found the solution. Enter MediaPlayerCtrl.cs and go down into the first ANDROID block and change it to the following:

 if(m_bSupportRockchip)
 {
     Call_SetRockchip(m_bSupportRockchip);
     
     if(strName.Contains("://"))
     {
         Call_Load(strName,0);
     }
     else
     {
         //Call_Load(strName,0);
         StartCoroutine( CopyStreamingAssetVideoAndLoad(strName));
     }
 
 }
 else
 {
     //Call_Load(strName,0);
     StartCoroutine( CopyStreamingAssetVideoAndLoad(strName));
 }

More specifically, I commented out the Call_Load function in the else block and loaded the video using the CopyStreamAssetVideoAndLoad and everything is working dandy now.

Couple of things to note:

  • I suspect this happens because Call_Load tries to load something locally that doesn't exist and CopyStreamingAssetVideoAndLoad actually looks in the streaming assets folder in the OBB and copies it locally a folder the apk can access.

  • As of version 2.16 of EasyMovieTexture, there is a sample project (package) called in the Scene folder called "Demo_SplitOBB". If you extract the contents and look at the file "MedaiPlayerSampleGUIObb.cs" you will see the way to properly build the URI.

There goes half my day but a solution is a solution and I hope this saves everyone time!

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How can I load a mp4 from a website to use as a Movie Texture at runtime? 0 Answers

Not able to play movie from streaming assets (Prime 31 Etcetera Plugin) Obb Split 1 Answer

apk +obb issue, the first scene is messy and the rest of the scenes can't load ! 0 Answers

obb apk scene load fail 1 Answer

Problem playing movietexture only with local file 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges