MediaPlayer not running - just blank screen

by Nithin » Thu, 05 Mar 2009 15:46:00 GMT


Sponsored Links
 hi,

I tried a simple mediaplayer application, just to run a .3gp file.
First, i put the .3gp file in "Raw" folder and tried to run, but
nothing is displaying, just blank screen only.... please guide me,
where i am going wrong. I dont have any xml file, is it needed ??

heres the code, which i am trying

import android.app.Activity;
import android.media.MediaPlayer;
import android.os.Bundle;

public class MonsterEntry extends Activity {

        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                MediaPlayer mediaplayer = MediaPlayer.create(this, 
R.raw.monster);
                mediaplayer.start();
        }
}

Thanks
Nithin
--~--~---------~--~----~------------~-------~--~----~



MediaPlayer not running - just blank screen

by dillirao malipeddi » Thu, 05 Mar 2009 15:56:00 GMT


 you must set parameters for playing video
see api demos - >examples media ->  video demo player






-- 
Dilli Rao. M
ARIJASOFT
+91 - 9703073540

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


Sponsored Links


MediaPlayer not running - just blank screen

by Dave Sparks » Thu, 05 Mar 2009 15:58:11 GMT


 You need to tell the mediaplayer where to display the video with
setDisplaySurface(). Check out the media demo apps on
developer.android.com.



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



MediaPlayer not running - just blank screen

by nithin » Thu, 05 Mar 2009 17:44:41 GMT


 hanks for your reply, but still not working.. Now i am trying with
this code...



import android.app.Activity;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.widget.MediaController.MediaPlayerControl;

public class Monster extends Activity implements
SurfaceHolder.Callback, MediaPlayer.OnPreparedListener {

SurfaceView mPreview;
SurfaceHolder holder;
MediaPlayer mediaplayer;
int mVideoWidth,mVideoHeight;

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.bushentry);
mPreview = (SurfaceView)findViewById(R.id.surface);
holder = mPreview.getHolder();
holder.addCallback(this);
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
mediaplayer = MediaPlayer.create(this, R.raw.monster);
mediaplayer.start();
mediaplayer.setDisplay(holder);
mediaplayer.setOnPreparedListener(this);
}
public void surfaceChanged(SurfaceHolder holder, int format, int
width,
int height) {

}
public void surfaceCreated(SurfaceHolder holder1) {
mVideoWidth = mediaplayer.getVideoWidth();
mVideoHeight = mediaplayer.getVideoHeight();
if (mVideoWidth != 0 && mVideoHeight != 0) {
holder.setFixedSize(mVideoWidth, mVideoHeight);
mediaplayer.start();
}
}
public void surfaceDestroyed(SurfaceHolder holder) {
}

public void onPrepared(MediaPlayer mp) {
mVideoWidth = mediaplayer.getVideoWidth();
mVideoHeight = mediaplayer.getVideoHeight();
if (mVideoWidth != 0 && mVideoHeight != 0) {
holder.setFixedSize(mVideoWidth, mVideoHeight);
mediaplayer.start();
}
}
}


Still, the same problem, no error, but blank screen, any idea please..

Nithin


On Mar 5, 12:58pm, Dave Sparks <davidspa...@android.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



MediaPlayer not running - just blank screen

by nithin » Thu, 05 Mar 2009 18:03:46 GMT


 o, there is no error in logcat...
i put log messages every where and logcat showing all messages, but no
video is playing..

Nithin

On Mar 5, 2:48pm, dillirao malipeddi <dillir...@arijasoft.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



MediaPlayer not running - just blank screen

by nithin » Thu, 05 Mar 2009 18:18:21 GMT


 a, i saw log messages, in that, getVideoSize returning -1.......

what may be the reason for that, any idea please..


Nithin


03-05 14:59:43.072: INFO/1111(324): 111111111111111
03-05 14:59:43.113: INFO/2222222(324): 22222222222222222222
03-05 14:59:43.123: INFO/333333333333333(324): 33333333333333
03-05 14:59:43.333: INFO/444444444444(324): 4444444444444444
03-05 14:59:43.412: INFO/66666666666(324): 66666666666666666666666
03-05 14:59:43.412: ERROR/MediaPlayerService(24): getVideoSize
returned -1
03-05 14:59:43.424: ERROR/MediaPlayerService(24): getVideoSize
returned -1
03-05 14:59:43.634: INFO/55555555555555555(324):
55555555555555555555555555
03-05 14:59:43.644: ERROR/MediaPlayerService(24): getVideoSize
returned -1
03-05 14:59:43.654: ERROR/MediaPlayerService(24): getVideoSize
returned -1
03-05 14:59:43.714: INFO/ActivityManager(46): Displayed activity
com.monster/.Monster: 735 ms
03-05 14:59:48.863: DEBUG/dalvikvm(94): GC freed 1037 objects / 53600
bytes in 68ms
03-05 14:59:51.931: WARN/AudioFlinger(24): write blocked for 157 msecs
03-05 14:59:53.465: WARN/AudioFlinger(24): write blocked for 146 msecs
03-05 14:59:54.915: WARN/AudioFlinger(24): write blocked for 259 msecs
03-05 14:59:55.094: WARN/AudioFlinger(24): write blocked for 130 msecs
03-05 14:59:55.190: WARN/AudioFlinger(24): write blocked for 58 msecs
03-05 14:59:55.449: WARN/AudioFlinger(24): write blocked for 96 msecs
03-05 14:59:56.705: WARN/AudioFlinger(24): write blocked for 75 msecs
03-05 15:05:42.232: DEBUG/dalvikvm(88): GC freed 9596 objects / 538312
bytes in 73ms
03-05 15:21:10.564: DEBUG/dalvikvm(88): GC freed 9289 objects / 524248
bytes in 90ms


On Mar 5, 3:03pm, nithin <nithin.war...@gmail.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



MediaPlayer not running - just blank screen

by nithin » Fri, 06 Mar 2009 15:38:21 GMT


 hanks marco, at last got it...

thanks for your valuable input..

Nithin

On Mar 5, 10:02pm, Marco Nelissen <marc...@android.com> wrote:
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. problem with the fix Button at of the list View

Hi all,

  I want a fix "Cancel" Button at the bottom of the ListView. I want
my list View to be scrollable and fix Button at Bottom.

  I had added the Button at the bottom of the list with addFooterView
(button);  but if list is longer than the screen, then we have to
scroll down to get the button and if list is very short then Button
will be at the middle of the screen just bellow the listview :(

 I got Ramain Guy's suggestion of setting height = "0dip" and weight =
"1" but by doing this nothing is appearing on the screen (blank view)

 note: my ListView is one tab of the TabHost.

Thanks,
Asif

-- 

2. Problem loading .so file using loadlibray function on Eclair

Hi All,

I am trying to run my service running on Android Donut on to Android
Eclair.
I am getting following unsatisfied linking error from Android Eclair.

====================================================================
Error Log :
====================================================================
I/SystemServer(  913): Notification Manager
I/SystemServer(  913): Mount Service
I/SystemServer(  913): Device Storage Monitor
I/SystemServer(  913): starting SUPL Service (SystemServer)
D/dalvikvm(  913): Trying to load lib /system/lib/
libsuplhelperservicejni.so 0x0
I/dalvikvm(  913): Unable to dlopen(/system/lib/
libsuplhelperservicejni.so): Cannot load library: reloc_library
[1244]:   890 cannot locate
'_ZN7android14AndroidRuntime21registerNativeMethodsEP7_JNIEnvPKcPK15JNINativeMethodi'...
W/dalvikvm(  913): Exception Ljava/lang/UnsatisfiedLinkError; thrown
during Lcom/android/server/SUPLServer;.<clinit>
W/dalvikvm(  913): threadid=51: thread exiting with uncaught exception
(group=0x4001b1b8)
E/AndroidRuntime(  913): Uncaught handler: thread SUPL Thread exiting
due to uncaught exception
E/AndroidRuntime(  913): *** EXCEPTION IN SYSTEM PROCESS.  System will
crash.
E/AndroidRuntime(  913): java.lang.ExceptionInInitializerError
E/AndroidRuntime(  913):        at com.android.server.SUPLService
$SUPLThread.run(SUPLService.java:59)
E/AndroidRuntime(  913): Caused by: java.lang.UnsatisfiedLinkError:
Library suplhelperservicejni not found
E/AndroidRuntime(  913):        at java.lang.Runtime.loadLibrary
(Runtime.java:489)
E/AndroidRuntime(  913):        at java.lang.System.loadLibrary(System.java:
557)
E/AndroidRuntime(  913):        at com.android.server.SUPLServer.<clinit>
(SUPLServer.java:73)
E/AndroidRuntime(  913):        ... 1 more
E/AndroidRuntime(  913): Crash logging skipped, no checkin service
I/Process (  913): Sending signal. PID: 913 SIG: 9
I/ServiceManager(  885): service 'SurfaceFlinger' died
I/ServiceManager(  885): service 'account' died
==================================================================

Here I am creating .so externally and getting load using
System.loadLibrary(libname).
It works fine with Android Donut, while working with same code on
Android Eclair I am getting above error.

Please provide your inputs on it.
Really Appreciate your help on it.


Thanks.

Regards,
_-_Mayank Rana_-_

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. Back-porting from Android 2.0 to Android 1.5

4. configChanges and orientation - unexpected behaviour

5. What is "Heap Worker" thread and what does it do?

6. Why Return null when using findViewById in Activity to find and handle CustomView?

7. Back-porting from Android 2.0 to Android 1.5