Android MediaPlayer/VideoView error (1, -2147483648)

As it turns out, error -2147483648 indicates an unknown error. This could have something to do with the video encoding, but it’s also worth checking that the file path exists and that the VideoView has permission to read it. My issue was that I was writing my files with Context.MODE_PRIVATE (the default). openFileOutput(filename, Context.MODE_PRIVATE); This … Read more

how to play video from url

It has something to do with your link and content. Try the following two links: String path=”http://www.ted.com/talks/download/video/8584/talk/761″; String path1=”http://commonsware.com/misc/test2.3gp”; Uri uri=Uri.parse(path1); VideoView video=(VideoView)findViewById(R.id.VideoView01); video.setVideoURI(uri); video.start(); Start with “path1”, it is a small light weight video stream and then try the “path”, it is a higher resolution than “path1”, a perfect high resolution for the mobile … Read more

Can a videoview play a video stored on internal storage?

MediaPlayer requires that the file being played has world-readable permissions. You can view the permissions of the file with the following command in adb shell: ls -al /data/data/com.mypackage/myfile You will probably see “-rw——“, which means that only the owner (your app, not MediaPlayer) has read/write permissions. Note: Your phone must be rooted in order to … Read more

How to play .mp4 video in videoview in android?

Finally it works for me. private VideoView videoView; videoView = (VideoView) findViewById(R.id.videoView); Uri video = Uri.parse(“http://www.servername.com/projects/projectname/videos/1361439400.mp4”); videoView.setVideoURI(video); videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { @Override public void onPrepared(MediaPlayer mp) { mp.setLooping(true); videoView.start(); } });

vimeo video play in Android native

I made a native player for vimeo, base by WebView. Support public and private video. Try it : https://github.com/ct7ct7ct7/Android-VimeoPlayer <com.ct7ct7ct7.androidvimeoplayer.view.VimeoPlayerView android:id=”@+id/vimeoPlayer” android:layout_width=”match_parent” android:layout_height=”wrap_content”/> VimeoPlayerView vimeoPlayer = findViewById(R.id.vimeoPlayer); getLifecycle().addObserver(vimeoPlayer); //public video vimeoPlayer.initialize(59777392); //If video is open. but limit playing at embedded. vimeoPlayer.initialize({YourPrivateVideoId}, “SettingsEmbeddedUrl”) //If video is pirvate. vimeoPlayer.initialize({YourPrivateVideoId},”VideoHashKey”, “SettingsEmbeddedUrl”)

Full screen videoview without stretching the video

Like this you can set the properties of the video by yourself. Use a SurfaceView (gives you more control on the view), set it to fill_parent to match the whole screen <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:orientation=”vertical” android:layout_width=”match_parent” android:layout_height=”fill_parent”> <SurfaceView android:id=”@+id/surfaceViewFrame” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:layout_gravity=”center” > </SurfaceView> </Linearlayout> then on your java code get the surface view and add … Read more

Get Real Path For Uri Android

Use this code .This is working for all android version.This is tested code.This support all devices public static String getPathFromUri(final Context context, final Uri uri) { final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; // DocumentProvider if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) { // ExternalStorageProvider if (isExternalStorageDocument(uri)) { final String docId = DocumentsContract.getDocumentId(uri); final String[] split = … Read more

Android MediaPlayer error (1, -2147483648)

Just to clarify something for anyone reading this question based on the title. When looking at the error value (1, -2147483648), the ‘1’ value corresponds to the constant in MediaPlayer.MEDIA_ERROR_UNKNOWN. -2147483648 corresponds to hexadecimal 0x80000000 which is defined as UNKNOWN_ERROR in frameworks/native/include/utils/Errors.h This shows that the error’s source is hard to pin down as it … Read more