Git Product home page Git Product logo

Comments (7)

ianrothmann avatar ianrothmann commented on June 3, 2024 2

It works like a charm! :) Thank you very much!

from unityionicintegration.

yasirkula avatar yasirkula commented on June 3, 2024

In our project, we have also used VideoPlayer to play a video on a marker. We were using asset bundles but we had to do a workaround because VideoPlayer didn't support playing VideoClip's from asset bundles back then. What we did was changing the extension of the video asset to ".bytes" and referencing it from our script with a TextAsset variable. Then, when the scene starts, we temporarily save the video to the local file system:

string path = Path.Combine( Application.temporaryCachePath, "temp.mp4" );
File.WriteAllBytes( path, videoClipTextAsset.bytes );

Afterwards, we tell the video player to play the video at that path:

videoPlayer.url = path;
videoPlayer.source = VideoSource.Url;

In conclusion, we played videos from url rather than from VideoClip assets.

from unityionicintegration.

yasirkula avatar yasirkula commented on June 3, 2024

I can't remember whether it was videoPlayer.url = path; or videoPlayer.url = "file://" + path; though.

from unityionicintegration.

ianrothmann avatar ianrothmann commented on June 3, 2024

Thank you very much, we'll try this today. I will post whether it solves the problem.

from unityionicintegration.

RyuuYuki avatar RyuuYuki commented on June 3, 2024

I solved this problem.
Put in the video folder in StreamingAssets/Ionic.mp4
After export, the video will be in the folder assets/Ionic.mp4
You can specify the path for the android with the following code:

videoPlayer.url = "jar:file://" + Application.dataPath + "!/assets/Ionic.mp4" ;

from unityionicintegration.

erickcouto avatar erickcouto commented on June 3, 2024

I'm still getting this error. My app just crash when the video start. Can you help me?

from unityionicintegration.

yasirkula avatar yasirkula commented on June 3, 2024

Are there any error messages in logcat/Xcode console?

from unityionicintegration.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.