I need a video library for "Processing Android" to play some videos in my game. I tried ApWidget VideoView but it works only when a video file is placed on sd card and its path is provided to video view object. But how can i play videos that are placed in data folder of my sketch?
My experience is assets such as videos or images have to be in the Assets folder in your app tree (I'm assuming you use Eclipse). Otherwise your assets won't export when you compile the app.
If there's an issue with the code, we need to see it to answer further. Best of luck!
Related
I made an app where a user can take multiple videos and concatenate them together using FFmpeg concat. I added an export video feature where you can export your concatenated video to your Gallery on your Android device. Currently I am using Expo Media Library but I am having issues with large files. It doesn't have to be a very large file. Ex. a 4-5 min. mp4 video recorded in 720p makes the MediaLibrary.saveToLibraryAsync() and MediaLibrary.createAssetAsync() functions to hang and eventually throw a generic exception Unable to save file to external storage. With smaller files I have no issues. Is there another way to copy a video file from the app folder to the Gallery/External Storage?.
Found a solution with the help of #blackapps, I am not sure if its a good solution but it is currently working for me.
import RNFS from 'react-native-fs';
const path = RNFS.ExternalStorageDirectoryPath + "/DCIM/video.mp4";
I am using the React Native File System library and I am directly generating my video file to the DCIM folder located at /storage/emulated/0/DCIM.
This only works through the FFmpeg command. If I try to copy the video to the DCIM folder with the File System library I will get an exception: Its not writable
I have used GallerySaver library but this works just with mp4, not with mp3.
I've used FlutterDownloader and MediaSaver library but I don't no why isn't working to save in Gallery folder or in Music folder.
I can save in cache folder in app but I don't want this because I'm going to have problems later.
Can someone give me an example of this, please?
Hello so I am trying to make online videos download on the android export app from unity and then play it back in the same app. so far I have used a plugin EasyMovieTexure asset for streaming online videos but cannot find a way to download videos and play them. I have searched and found that I can download the video with Android Application.persistentDataPath but I don't know how to use it and save the video file to a location on android.
Help is much appreciated.
the easiest way will be using System.IO.File.WriteAllBytes () to save all byte data from the WWW object. But this method actually need RAM to hold the whole file for a while. It doesn't work if the file is too big. if the file size is too big, you probably need another way to do the downloading and saving
The Android supports flash files?
How I can integrate this?
WebView??
Integrate with some tool of Adobe??
The idea is have local flash files and play that inside of my application.
Short Answer:
Yes, you can play flash files in android app using just a Webview.
Long Answer:
You have to create an html file with embedded swf file. See sample here http://pastebin.com/BYrfKmea
After that You can put html and swf files in assets folder and try opening it in a WebView by
mWebView.loadUrl("file:///android_asset/player.html");.
This thread also might be useful.
I have my android app where data is packed using FileWrap. The thing is I want to wrap the mp3 data into the android file and play from that memory. I have checked the nativeaudio example in NDK which shows how to play MP3 as an asset or as a filesystem file, but it does not show how I can play an MP3 that is embedded into memory.
Please help. Thanks.
I don't think that is possible... yet.
AFAIK android opensl only supports MP3 decode & playback from a stream...
I have not seen the latest ndk release (r9b) yet, but if the opensl example app does not support in-memory, on-the-fly decoding, I doubt it is available.
Perhaps having a look here may clear things up:
https://groups.google.com/forum/#!searchin/android-ndk/opensl|sort:date/android-ndk/cMHlkyQkFU0/vMkyO2201yYJ
Or you could just dump your MP3 files in the "assets" folder and play them using the AAssetManager as per usual.