[android-developers] Re: how to save a streaming into SD card?

2010-10-09 Thread Charlie88
hi 097,

which task do you mean I can't do at app level?

Charlie

On Oct 9, 2:22 pm, 097 sphinxdw...@gmail.com wrote:
 I'm afraid you can't at app level.

 On Oct 9, 12:02 pm, Charlie88 charliel...@gmail.com wrote:



  hi cindy,

  Do you know how can I save a streaming video from the position the
  MediaPlayer is currently playing?
  Because since the streaming is already playing, I assume all the
  connection is fine. Can I use some shortcut commands to save the
  current playing streaming video? Thanks.

  Charlie

  On Oct 9, 11:53 am, cindy ypu01...@yahoo.com wrote:

   you can open a file, and write the content to file.

   On Oct 8, 8:42 pm, Charlie88 charliel...@gmail.com wrote:

Anyone know the mechanism of saving streaming in Android? Is it
related to the network condition? And how should I specify the path of
the file in SD card in my saving command? Thanks.- Hide quoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] how to save a streaming into SD card?

2010-10-08 Thread Charlie88
Anyone know the mechanism of saving streaming in Android? Is it
related to the network condition? And how should I specify the path of
the file in SD card in my saving command? Thanks.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: how to save a streaming into SD card?

2010-10-08 Thread Charlie88
hi cindy,

Do you know how can I save a streaming video from the position the
MediaPlayer is currently playing?
Because since the streaming is already playing, I assume all the
connection is fine. Can I use some shortcut commands to save the
current playing streaming video? Thanks.

Charlie

On Oct 9, 11:53 am, cindy ypu01...@yahoo.com wrote:
 you can open a file, and write the content to file.

 On Oct 8, 8:42 pm, Charlie88 charliel...@gmail.com wrote:



  Anyone know the mechanism of saving streaming in Android? Is it
  related to the network condition? And how should I specify the path of
  the file in SD card in my saving command? Thanks.- Hide quoted text -

 - Show quoted text -

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Key Dispatching Time Out problem

2010-10-07 Thread Charlie88
Hi, I am trying to buffer a video stream and play the video from the
buffer file, but it seems not to work. I check the logcat, it says
something about Key Dispatching Time Out problem. Does anyone know
what's wrong? The problem is probably due to CPU consuption because
this error appears after I wrong the same programme several times.
Here is my code.

package com.example.Client2;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;

import android.app.Activity;
import android.os.Bundle;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnBufferingUpdateListener;
import android.media.MediaPlayer.OnCompletionListener;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.webkit.URLUtil;
import android.widget.ImageButton;
import android.widget.Button;
import android.util.Log;
import android.view.View;

//import android.view.Display;
//import android.view.WindowManager;
//import android.view.ViewGroup.LayoutParams;
//import android.widget.RelativeLayout;
//import android.view.Gravity;



public class Client2 extends Activity implements
  OnBufferingUpdateListener,
  OnCompletionListener,
  MediaPlayer.OnPreparedListener,
  SurfaceHolder.Callback{

private static final String TAG=MediaPlayer;
private MediaPlayer mMediaPlayer;
private SurfaceView mPreview;
private SurfaceHolder   holder;
private String  path;
private int mVideoWidth;
private int mVideoHeight;
private static final int LOCAL_VIDEO = 1;
private static final int STREAM_VIDEO = 2;
//private static final int CENTER = 17;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

mPreview=(SurfaceView) findViewById(R.id.surface);
holder=mPreview.getHolder();
holder.addCallback(this);
//holder.setFixedSize(30, 30);
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);

ImageButton Play = (ImageButton) findViewById(R.id.play);
ImageButton Pause = (ImageButton) findViewById(R.id.pause);
Button Stream = (Button) findViewById(R.id.stream);

//checkOrientation();

Play.setOnClickListener(new View.OnClickListener(){
public void onClick(View view){
playVideo(LOCAL_VIDEO);
}
});

Pause.setOnClickListener(new View.OnClickListener(){
public void onClick(View view){
mMediaPlayer.pause();
}
});

Stream.setOnClickListener(new View.OnClickListener(){
public void onClick(View view){
playVideo(STREAM_VIDEO);
}
});
}

/*  private void checkOrientation()
{
 WindowManager wm = getWindowManager();
 Display d = wm.getDefaultDisplay();
 Log.d(TAG,ok1);

 LayoutParams params;

 Log.d(TAG,ok2);
 if (d.getWidth()  d.getHeight())
 {
Log.d(TAG,ok3);
 //---landscape mode---
 params = new RelativeLayout.LayoutParams(200,200);
 Log.d(TAG,ok4);

 }
 else
 {
 //---portrait mode---
 params = new RelativeLayout.LayoutParams(200,200);
 }
 Log.d(TAG,ok5);
 mPreview.setLayoutParams(params);
}*/

private void playVideo(Integer Media)
{
try
{
switch (Media){
case LOCAL_VIDEO:
path=/sdcard/toystory3.3gp;
break;
case STREAM_VIDEO:
Log.d(TAG,check);
//path=rtsp://172.17.179.200:5544/stream;
path=http://172.17.179.200:8080/stream;;
break;
}

mMediaPlayer=new MediaPlayer();
Log.d(TAG,Here...);
//setDataSource(path);
mMediaPlayer.setDataSource(path);
mMediaPlayer.setDisplay(holder);
mMediaPlayer.prepare();

mMediaPlayer.setOnBufferingUpdateListener(this);
mMediaPlayer.setOnCompletionListener(this);
mMediaPlayer.setOnPreparedListener(this);

mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
Log.d(TAG,Debug);
mVideoWidth=mMediaPlayer.getVideoWidth();
mVideoHeight=mMediaPlayer.getVideoHeight();

[android-developers] Video buffer issue

2010-10-07 Thread Charlie88
Hi all,

Recently I am doing a video streaming control stuff, which means I use
VLC to stream video into Android client. But I meet some trouble in
pause the streaming and resume it at some time later. Can anyone offer
some ideas how to realize this goal? I try to use tempary file to
store the video stream and play from it (like a buffer), but fails.
Someone please help on this. Thanks in advance

Charlie

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Key dispatching time out?

2010-10-07 Thread Charlie88
I repeated get the warning from logcat. What does this annoying
message mean?

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en