-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VideoEditor reference error #31
Comments
Try wrapping your code in a timeout like so: $timeout(function(){
VideoEditor.transcodeVideo(
videoTranscodeSuccess,
videoTranscodeError,
{
fileUri: videoFile.fullPath,
outputFileName: YOUR_TRANSCODED_FILE,
quality: VideoEditorOptions.Quality.LOW_QUALITY,
outputFileType: VideoEditorOptions.OutputFileType.MPEG4,
optimizeForNetworkUse: VideoEditorOptions.OptimizeForNetworkUse.YES
}
);
},100); |
Thx, I got this work correctly now, the problem was on phonegap dev tools that I used to emulate android and it seems that tool is not reliable for debugging, too many false error Anyway, are there some tips to speed up the encoding process, I got more than 2 minutes when encoding a 1 minute low quality video file, tested on android lollipop oneplus one cyanogen rom nb: this is the app that I used to debug https://play.google.com/store/apps/details?id=com.adobe.phonegap.app |
While this might not be the exact solution you are looking for, heres what I did. 1.) I limited the video length to 10 seconds. If you really need long videos, thats fine, my second solution should help with that. But I decided 10 seconds was long enough for my needs. 2.) Do the transcoding in the background. I created a video service that takes the video file returned from the cordova media plugin, and that service handles the transcoding and uploading. This allows the user to keep using the app while in the background, their video is being processed. I also display a useful message that changes as it processes ("Transcoding video....", "Generating thumbnail..." , "Uploading Video..." etc). and that helps with the longer processing times. The only issue I see with this is there may be some slow down as the video processes, so I limit what the user can do while its processing. I hope that helps! |
Do you have any tutorial to create video service like you did? I've tried red folder plugin with no luck |
Sure, I'll write something up in the next couple days. |
I'd also be interested in something like that @DaDanny . |
Wow thx, I'm gonna wait your post @DaDanny. In the meanwhile this is my temporary solution, |
http://codepen.io/DaDanny/pen/jbePjN So honestly I'm not doing anything crazy. I just have a service which takes in the normal video file and transcodes that and then will upload it to AWS(not in example). I left out a few things that were more specific to my app, but this should still work for you guys. I've tested it quite a few times and it works great for my use case. The only issue I see is if someone kills the app while a video is being transcoded, but so far I haven't had any issues. I also limit videos to 10sec, so the longest I've had to wait for a video to process is about 20-25 seconds. If you are worried about someone taking a video then immediately killing the app, then a workaround would be like @kh411d suggested with the background plugin, but I never used it and haven't had any complaints with my current solution. I just tested it on Android, and if the user hits the Android home button and sends the app to the background, this will still work as expected. However, if they force close out of the app, it will not work. So if you are worried about someone killing the app while they are transcoding a video, then you will need another solution which I don't have currently. Let me know if you guys have any other questions. I'm making an app that lets people take videos and send those to their friends and it generates Thumbnails for every video, and does it pretty fast. If you guys would like to see how I did that, I've been thinking of writing an actual tutorial :) |
This should be fixed in the latest version - https://github.com/jbavari/cordova-plugin-video-editor/tree/0.0.6 Thanks for sharing the info @DaDanny |
installed with this command,
cordova plugin add https://github.com/jbavari/cordova-plugin-video-editor.git
Got Reference Error issue here,
[phonegap] [console.error] ReferenceError: VideoEditor is not defined
I've tried serveral way to load,
load with deviceReady but still not resolve the issue.
"navigator.device.VideoEditor" still not resolve the issue.
"$window.plugins.VideoEditor" still not resolve the issue.
creating ngCordova plugins doesn't work either.
I really have a hard time to debug this
any help guys.. I'm using Cordova 5.2.0
The text was updated successfully, but these errors were encountered: