problem with VIDEOVIEW

All your problems with Audio, Video and Images.

problem with VIDEOVIEW

Postby bins1984 » Thu May 22, 2008 10:56 am

hi......

i have the proble with the video view i will post my code down .......its not working...

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. import android.net.Uri;
  2.  
  3. import android.os.Bundle;
  4.  
  5. import android.widget.VideoView;
  6.  
  7. public class musicplayer extends Activity {
  8.  
  9.              
  10.  
  11.     @Override
  12.  
  13.     public void onCreate(Bundle icicle) {
  14.  
  15.      
  16.  
  17.         super.onCreate(icicle);
  18.  
  19.         setContentView(R.layout.main);
  20.  
  21.         VideoView vv=(VideoView)findViewById(R.id.vdoplayer);
  22.  
  23.        // MediaPlayer mp=new MediaPlayer();
  24.  
  25.        
  26.  
  27.       // Uri myUrl = Uri.parse("http://207.210.108.32/Music/Crazy.3gp");
  28.  
  29.        // vv.setVideoURI(myUrl);
  30.  
  31.         vv.setVideoPath("http://207.210.108.32/Music/Alarm.wmv");
  32.  
  33.         vv.start();
  34.  
  35.        
  36.  
  37.      
  38.  
  39.     }
  40.  
  41. }
Parsed in 0.038 seconds, using GeSHi 1.0.8.4





this is the java file andd xml given below


Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. ]syntax="xml"]<?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  4.  
  5.    android:orientation="vertical"
  6.  
  7.    android:layout_width="fill_parent"
  8.  
  9.    android:layout_height="fill_parent"
  10.  
  11.    >
  12.  
  13. <Button android:id="@+id/cmd_play"
  14.  
  15.    android:layout_width="fill_parent"
  16.  
  17.    android:layout_height="wrap_content"
  18.  
  19.    android:text="Play the music !!!"
  20.  
  21.    />
  22.  
  23.     <VideoView
  24.  
  25.    android:id="@+id/vdoplayer"
  26.  
  27.    android:layout_width="fill_parent"
  28.  
  29.    android:layout_height="300px"
  30.  
  31.    />
  32.  
  33. </LinearLayout>
  34.  
  35.  
Parsed in 0.002 seconds, using GeSHi 1.0.8.4





but is not working.....i was trying with the my own server....it is getting in browser....but not working with the video view.......can any body help me.......



or can any body tell me how to access and play video on the emulator .....



please...
with thanks bins........
User avatar
bins1984
Experienced Developer
Experienced Developer
 
Posts: 67
Joined: Fri Feb 08, 2008 8:20 am
Location: India

Top

Postby zjsst1214 » Fri Jul 18, 2008 8:20 am

Hi bins1984:

I think android don't support wmv now,you can try a mp4 file,i successed when use a local mp4 file,and i

know mpeg also don't work.
纵马天涯
zjsst1214
Freshman
Freshman
 
Posts: 7
Joined: Fri Jun 13, 2008 7:42 am

Postby AsTeR » Mon Jul 21, 2008 3:08 pm

You have also to call the prepare method on your media player and then add an onPrepared listener.

Good luck ;)
AsTeR
Junior Developer
Junior Developer
 
Posts: 19
Joined: Tue Jun 17, 2008 8:36 am

Re: problem with VIDEOVIEW

Postby bins1984 » Fri May 21, 2010 1:19 pm

AssetFileDescriptor fd = mParentActivity.getResources().getAssets().openFd("tomandjerry.3gp");

mMediaPlayer.setDataSource(fd.getFileDescriptor(),fd.getStartOffset(),fd.getLength());
User avatar
bins1984
Experienced Developer
Experienced Developer
 
Posts: 67
Joined: Fri Feb 08, 2008 8:20 am
Location: India

Re: problem with VIDEOVIEW

Postby fbarnard » Tue Jun 15, 2010 3:33 pm

fbarnard
Developer
Developer
 
Posts: 44
Joined: Tue Jun 15, 2010 12:31 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 18 guests