Git Product home page Git Product logo

Comments (36)

muhammad-umair-khan avatar muhammad-umair-khan commented on June 24, 2024

follow this link for selection of video from gallery:
https://stackoverflow.com/questions/2507898/how-to-pick-an-image-from-gallery-sd-card-for-my-app/34348903#34348903

After selection do something like this: mMediaplayer.setDataSource(selected video path);
and then follow the same procedure.

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

I followed your link, but still unable to open video from gallery. :(

from videffects.

muhammad-umair-khan avatar muhammad-umair-khan commented on June 24, 2024

what is your os you are testing on?

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

Em testing on kitkat and lollipop

from videffects.

muhammad-umair-khan avatar muhammad-umair-khan commented on June 24, 2024

send me your code for this case.
email: [email protected]

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

Check your email

from videffects.

muhammad-umair-khan avatar muhammad-umair-khan commented on June 24, 2024

are you getting any exception?

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

Nop

from videffects.

muhammad-umair-khan avatar muhammad-umair-khan commented on June 24, 2024

if possible then send me the code of your particular fragment.

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

ok..check email

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

Any luck?

from videffects.

muhammad-umair-khan avatar muhammad-umair-khan commented on June 24, 2024

not received email yet

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

Just sent again

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

Received?

from videffects.

muhammad-umair-khan avatar muhammad-umair-khan commented on June 24, 2024

no.check email address please

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

[email protected]
is it ur email?

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

better check spam

from videffects.

muhammad-umair-khan avatar muhammad-umair-khan commented on June 24, 2024

yeah its spammed

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

Just waiting for your help.

from videffects.

muhammad-umair-khan avatar muhammad-umair-khan commented on June 24, 2024

This part is creating problem:

  try {
     AssetFileDescriptor afd = getAssets().openFd("sample.mp4");
            mMediaPlayer.setDataSource(afd.getFileDescriptor(),
                    afd.getStartOffset(), afd.getLength());
        
        } catch (Exception e) {
            Toast.makeText(this, e.getMessage(), Toast.LENGTH_SHORT).show();
        }
    
        mVideoView.init(mMediaPlayer,
                new BrightnessEffect(0.0f));

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

Well what should i do in onCreate?

from videffects.

muhammad-umair-khan avatar muhammad-umair-khan commented on June 24, 2024

now it depends upon your requirements. Or if you want to test things then simple call

if (Build.VERSION.SDK_INT <= 19) {
    Intent i = new Intent();
    i.setType("video/*");
    i.setAction(Intent.ACTION_GET_CONTENT);
    i.addCategory(Intent.CATEGORY_OPENABLE);
    startActivityForResult(i, REQUEST_TAKE_GALLERY_VIDEO);
} else if (Build.VERSION.SDK_INT > 19) {
    Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Video.Media.EXTERNAL_CONTENT_URI);
    startActivityForResult(intent, REQUEST_TAKE_GALLERY_VIDEO);
}

in your onCreate and in onActivityResult do this part:

 mVideoView.init(mMediaPlayer,
                new YourEffect());

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

Let me tell you scenario.
When app i launch, there'll be sample video playing on the screen. User have to select video from gallery by click optionsMenu.

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

Alright, let me make some changes. Please be there for help. Thank you

from videffects.

muhammad-umair-khan avatar muhammad-umair-khan commented on June 24, 2024

in onActivityResult do this part:

mVideoView.setVideoPath(selectedVideoPath);
mVideoView.start();

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

mVideoView.setVideoPath(selectedVideoPath);
mVideoView.start();
Doesn't exist

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

mVideoView.init(mMediaPlayer,
new BrightnessEffect(0.0f));
When i do above code in onCreate, it throws this exception
java.lang.IllegalStateException
at android.media.MediaPlayer.prepare(Native Method)
at com.sherazkhilji.videffects.view.VideoSurfaceView$VideoRender.onSurfaceCreated(VideoSurfaceView.java:276)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1501)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

any luck?

from videffects.

muhammad-umair-khan avatar muhammad-umair-khan commented on June 24, 2024

dont initialize videoview in onCreate if asked you to do it in onActivityResults

try {

               mMediaPlayer.setDataSource(selectedImagePath);
               mVideoView.init(mMediaPlayer,new BrightnessEffect(0.0f));

           } catch (IOException e) {
               e.printStackTrace();
           }
          

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

This is my onCreate
` mVideoView = (VideoSurfaceView) findViewById(R.id.mVideoSurfaceView);

    mResources = getResources();
    mMediaPlayer = new MediaPlayer();`

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

when i run app, it gives me NullPointerException

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

Exception
java.lang.NullPointerException
at com.sherazkhilji.videffects.view.VideoSurfaceView$VideoRender.onSurfaceCreated(VideoSurfaceView.java:207)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1501)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

from videffects.

muhammad-umair-khan avatar muhammad-umair-khan commented on June 24, 2024

share your fresh code now

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

Check email

from videffects.

shahzad1 avatar shahzad1 commented on June 24, 2024

any luck?

from videffects.

muhammad-umair-khan avatar muhammad-umair-khan commented on June 24, 2024

i would suggest you to first take a look at video view and media player documentation. Your problem will be resolved as its not related to this particular library.

from videffects.

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.