Thanks for the help Jeremiah. I tried what you had suggested and it still isnt working. I hate to paste a lot of code, but I have done so below in hopes that you may see something I am doing incorrectly with my assignment of the media controller or something. From all I have seen online, this should be working and Im wondering if maybe all these issues are due to something I just happened to not grasp in putting this together.
1public class VideoViewDemo extends Activity implements SurfaceHolder.Callback{
2 private static final String TAG = "VideoViewDemo";
3
4 private CustomVideoView mVideoView;
5 private EditText mPath;
6 private EditText mMessageText;
7 private String current;
8 private MediaController mMediaCont;
9
10 @Override
11 public void onCreate(Bundle icicle) {
12 super.onCreate(icicle);
13 setContentView(R.layout.main);
14 mVideoView = (CustomVideoView) findViewById(R.id.custom_videoview);
15 mVideoView.setVideoViewListener(new CustomVideoView.VideoViewListener() {
16
17 @Override
18 public void onPlay() {
19 System.out.println("Play!");
20 }
21
22 @Override
23 public void onPause() {
24 System.out.println("Pause!");
25 }
26
27 @Override
28 public void onSeekTo(int msec){
29 System.out.println("Seek!");
30 }
31 });
32
33 mMediaCont = new MediaController(this);
34 mMediaCont.setPadding(0, 0, 0, 100);
35 mVideoView.setMediaController(mMediaCont);
36 mMediaCont.setAnchorView(mVideoView);
37 mVideoView.setOnCompletionListener(new OnCompletionListener() {
38 @Override
39 public void onCompletion(MediaPlayer mp) {
40 sendStopBeacon();
41 Toast.makeText(getApplicationContext(), "Video completed", Toast.LENGTH_LONG).show();
42 }
43 });
44
45 mMediaCont.setOnClickListener(new OnClickListener(){
46
47 @Override
48 public void onClick(View v) {
49 // TODO Auto-generated method stub
50 Log.d("In slider onclick", "WE HAVE LIFT OFF");
51 }});
52
53 mMessageText = (EditText) findViewById(R.id.MessageText);
54 mMessageText.setMovementMethod(new ScrollingMovementMethod());
55
56 mPath = (EditText) findViewById(R.id.path);
57
58 runOnUiThread(new Runnable(){
59 public void run() {
60 playVideo();
61 mMessageText.requestFocus();
62 }
63 });
64 }
65
66 @Override
67 public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
68 }
69
70 @Override
71 public void surfaceCreated(SurfaceHolder holder) {
72 mMediaCont.show();
73 }
74
75 @Override
76 public void surfaceDestroyed(SurfaceHolder holder) {
77 }
78}
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.