1

main.xml

 <?xml version="1.0" encoding="utf-8"?>
    <io.vov.vitamio.widget.CenterLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/video_root"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@android:color/black"
        android:orientation="horizontal" >

        <io.vov.vitamio.widget.VideoView
            android:id="@+id/video"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            android:saveEnabled="true" />                   

    </io.vov.vitamio.widget.CenterLayout>

MainActivity.java

public class MainActivity extends Activity {

private String path = "http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8";
private VideoView mVideoView;



public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main); 

    test_2();             
} 

private void test_2() throws VitamioNotCompatibleException, VitamioNotFoundException, NameNotFoundException{
    VR.init(getApplicationContext());
   mVideoView =(VideoView)findViewById(R.id.VideoView);
   mVideoView.setVideoPath(path);
   mVideoView.setVideoQuality(MediaPlayer.VIDEOQUALITY_HIGH);
   mVideoView.setMediaController(new MediaController(this));
}

}

Manifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.videovit"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="15" />
    <uses-permission android:name="android.permission.GET_TASKS" />

    <application

        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/title_activity_main" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>


</manifest>

Error: when I run the program, i got error on main.xml. i dont know what is the main problem in this code. i try to play flv file from remote url in videoview. i also try to add in manifest file. but dnt knw what liabrary i should add in that.

swiftBoy
  • 35,607
  • 26
  • 136
  • 135
Sagar Maiyad
  • 12,655
  • 9
  • 63
  • 99

1 Answers1

0

You are using custom widgets for your layout. Is your io.vov.vitamio.widget.CenterLayout included to the classpath? Perphaps Android just can't resolve your csutom widget and gives you an error.

Artemis
  • 4,821
  • 3
  • 21
  • 24