Making VideoView play automatically

by Miguel Paraz » Sat, 25 Apr 2009 14:40:17 GMT


Sponsored Links
 Hi,
How can I make a VideoView play immediately, without the user having
to select the MediaPlayer UI Play button? Thanks!
--~--~---------~--~----~------------~-------~--~----~



Making VideoView play automatically

by Nithin Varamballi » Sat, 25 Apr 2009 14:55:56 GMT


 HI...
          Create one one obect of VideoView
         then give objectname .start();

Thank You
Nithin N V

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Making VideoView play automatically

by Miguel Paraz » Sat, 25 Apr 2009 16:27:03 GMT


 



Thanks for the reply!

Nothing happens, though. No logcat logs.


--~--~---------~--~----~------------~-------~--~----~



Making VideoView play automatically

by Nithin Varamballi » Sat, 25 Apr 2009 16:33:05 GMT


 Try this code... This code woks for me......

package mypack.mydemos;

import android.app.Activity;
import android.graphics.PixelFormat;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;

public class demo extends Activity {
    /** Called when the activity is first created. */
        private VideoView myVideo,myVideo1;
        private MediaController mc,mc1;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        getWindow().setFormat(PixelFormat.TRANSLUCENT);
                setContentView(R.layout.main);
        
                        myVideo1=(VideoView)findViewById(R.id.video);
                        myVideo1.setVideoPath("/sdcard/nithin.mp4");
                        myVideo1.start();
                        mc1=new MediaController(this);
                        mc1.setMediaPlayer(myVideo1);
                        myVideo1.setMediaController(mc1);
                        //mc.show(RESULT_OK);
                        myVideo1.requestFocus();
    }
}

Thsnk You
Nithin N V

--~--~---------~--~----~------------~-------~--~----~



Making VideoView play automatically

by Miguel Paraz » Sat, 25 Apr 2009 18:31:55 GMT


 


Yes, it works!

The key is to start() before attaching the MediaController.

Thank you.
--~--~---------~--~----~------------~-------~--~----~



Making VideoView play automatically

by l hx » Tue, 28 Apr 2009 20:21:01 GMT


 now i found a matter in my device,but the emulation is ok. that is, when  i
use the movieview in camera to play video ,but when i come back to another
activity in my app. the orientation of the screen is also transverse. who
know why?





--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Why My application could play http but not rtsp?

I wrote a application .It could playback the internet video and
audio , if I give it a address begin with "http://".But when I input
the address that is beginning with the "rtsp://",It could not play.

Log:
I/ActivityManager( 1074): Process com.android.voicedialer (pid 2152)
has died.
I/ActivityManager( 1074): Low Memory: No more background processes.
D/skia    ( 1122): purging 10K from font cache [1 entries]
I/ActivityManager( 1074): Starting activity: Intent
{ act=android.intent.action.MAIN cat=
[android.intent.category.LAUNCHER] flg=0x10200000
cmp=com.android.Test/.Test_Main }
I/ActivityManager( 1074): Start proc com.android.Test for activity
com.android.Test/.Test_Main: pid=2163 uid=10020 gids={}
I/WindowManager( 1074): Setting rotation to 1, animFlags=0
I/WindowManager( 1074): Config changed: { scale=1.0 imsi=0/0 loc=en_US
touch=3 keys=1/1/2 nav=1 orien=2}
D/StatusBar( 1074): updateResources
W/IInputConnectionWrapper( 1122): showStatusIcon on inactive
InputConnection
I/ActivityManager( 1074): Displayed activity
com.android.Test/.Test_Main: 989 ms (total 989 ms)
I/ActivityManager( 1074): Starting activity: Intent
{ cmp=com.android.Test/.StreamTest.Test }
I/ActivityManager( 1074): Displayed activity
com.android.Test/.StreamTest.Test: 137 ms (total 137 ms)
I/ActivityManager( 1074): Starting activity: Intent
{ act=android.intent.action.VIEW dat=rtsp://125.76.233.38/h264.3gp
typ=video/* cmp=com.android.camera/.MovieView }
I/ActivityManager( 1074): Start proc com.android.camera for activity
com.android.camera/.MovieView: pid=2170 uid=10003 gids={1006, 1015,
2001, 3003}
W/InputManagerService( 1074): Starting input on non-focused client
com.android.internal.view.iinputmethodclient$stub$pr...@4384c6a8
(uid=10020 pid=2163)
W/IInputConnectionWrapper( 2163): showStatusIcon on inactive
InputConnection
V/VideoView( 2170): reset duration to -1 in openVideo
I/ActivityManager( 1074): Displayed activity
com.android.camera/.MovieView: 2300 ms (total 2300 ms)
I/ActivityManager( 1074): Process com.android.Test (pid 2163) has
died.
I/WindowManager( 1074): WIN DEATH: Window{437bb600 com.android.Test/
com.android.Test.Test_Main paused=false}
I/WindowManager( 1074): WIN DEATH: Window{4381f0c8 com.android.Test/
com.android.Test.StreamTest.Test paused=false}
I/ActivityManager( 1074): Low Memory: No more background processes.
W/QCvdec  ( 1029): get_parameter: unknown param 0ff7a347
D/skia    ( 1122): purging 33K from font cache [4 entries]
D/skia    ( 1074): purging 43K from font cache [6 entries]
D/skia    ( 2170): purging 21K from font cache [3 entries]
E/PlayerDriver( 1029): Command PLAYER_PREPARE completed with an error
or info PVMFFailure
W/PlayerDriver( 1029): PVMFInfoErrorHandlingComplete
E/MediaPlayer( 2170): error (1, -1)
E/MediaPlayer( 2170): Error (1,-1)
D/VideoView( 2170): Error: 1,-1
E/MediaPlayer( 2170): stop called in state 0
E/MediaPlayer( 2170): error (-38, 0)



--~--~---------~--~----~------------~-------~--~----~

2. Apn Switching to default

Hi,

when ever Apn Swithed to default, if already one data application is
running with the specified APN, Does it will wait up to that data
application ends? or it will close that Data application also?

How can we set our Specified APN from the application?


Thanks
Santosh.
--~--~---------~--~----~------------~-------~--~----~

3. Problem with Dialog theme when launching from another activity

4. setImageMatrix has no effect?

5. Help on android-port to mini2440

6. Android NDK ( Native code Debugging)

7. How to do we take a Screenshot using ADB Comand Line