Comments (7)
It works like a charm! :) Thank you very much!
from unityionicintegration.
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.
I can't remember whether it was videoPlayer.url = path;
or videoPlayer.url = "file://" + path;
though.
from unityionicintegration.
Thank you very much, we'll try this today. I will post whether it solves the problem.
from unityionicintegration.
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.
I'm still getting this error. My app just crash when the video start. Can you help me?
from unityionicintegration.
Are there any error messages in logcat/Xcode console?
from unityionicintegration.
Related Issues (20)
- ERROR: Couldn't find method compile() ... HOT 4
- Ionic Cloud Build? HOT 1
- Android Studio: Failed to process unity-classes.jar HOT 9
- Sending of String not working from Ionic to Unity and vice versa. HOT 6
- Ionic 4 compatibility HOT 4
- Undefined symbols for architecture arm64 HOT 2
- Ionic Cordova Automation Script HOT 1
- No Members named "*" in namespace "il2cpp::icalls::mscorlib::System::reflection::..." HOT 3
- ERROR: Manifest merger failed: Attribute application @ debuggable HOT 8
- app crash when launch unity HOT 3
- app crash when try to open unity HOT 3
- ios issue HOT 8
- Ionic 4 Capacitor HOT 2
- Ionic 4 Duplicate Classes [ Capacitor ] HOT 1
- How to pass message from OnMessageReceivedFromIonic() to other classes HOT 4
- Cannot find module 'unityARCaller' HOT 5
- On click app is crashing. openUnity() function is calling on button click. Using unity 2019.4.10f1 and gradle 6.5. with Ionic CLI 6.11.7
- Type bitter.jnibridge.JNIBridge$a is defined multiple times HOT 18
- library not found for -lUnityARKit HOT 6
- App crashing on startup HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unityionicintegration.