<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Android_Studio%3A_Video_Player_Sederhana_2</id>
	<title>Android Studio: Video Player Sederhana 2 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Android_Studio%3A_Video_Player_Sederhana_2"/>
	<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Android_Studio:_Video_Player_Sederhana_2&amp;action=history"/>
	<updated>2026-04-20T19:13:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://lms.onnocenter.or.id/wiki/index.php?title=Android_Studio:_Video_Player_Sederhana_2&amp;diff=64719&amp;oldid=prev</id>
		<title>Unknown user: Created page with &quot;==Copy Video .AVI==   mkdir ~/AndroidStudioProjects/videoplayer2/app/src/main/res/raw  cp video1.avi ~/AndroidStudioProjects/videoplayer2/app/src/main/res/raw  ==activity_main...&quot;</title>
		<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Android_Studio:_Video_Player_Sederhana_2&amp;diff=64719&amp;oldid=prev"/>
		<updated>2022-03-17T07:01:52Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==Copy Video .AVI==   mkdir ~/AndroidStudioProjects/videoplayer2/app/src/main/res/raw  cp video1.avi ~/AndroidStudioProjects/videoplayer2/app/src/main/res/raw  ==activity_main...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Copy Video .AVI==&lt;br /&gt;
&lt;br /&gt;
 mkdir ~/AndroidStudioProjects/videoplayer2/app/src/main/res/raw&lt;br /&gt;
 cp video1.avi ~/AndroidStudioProjects/videoplayer2/app/src/main/res/raw&lt;br /&gt;
&lt;br /&gt;
==activity_main.xml==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;androidx.constraintlayout.widget.ConstraintLayout xmlns:android=&amp;quot;http://schemas.android.com/apk/res/android&amp;quot;&lt;br /&gt;
     xmlns:app=&amp;quot;http://schemas.android.com/apk/res-auto&amp;quot;&lt;br /&gt;
     xmlns:tools=&amp;quot;http://schemas.android.com/tools&amp;quot;&lt;br /&gt;
     android:layout_width=&amp;quot;match_parent&amp;quot;&lt;br /&gt;
     android:layout_height=&amp;quot;match_parent&amp;quot;&lt;br /&gt;
     tools:context=&amp;quot;.MainActivity&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;VideoView&lt;br /&gt;
         android:id=&amp;quot;@+id/simpleVideoView&amp;quot;&lt;br /&gt;
         android:layout_width=&amp;quot;match_parent&amp;quot;&lt;br /&gt;
         android:layout_height=&amp;quot;match_parent&amp;quot;&lt;br /&gt;
         app:layout_constraintBottom_toBottomOf=&amp;quot;parent&amp;quot;&lt;br /&gt;
         app:layout_constraintLeft_toLeftOf=&amp;quot;parent&amp;quot;&lt;br /&gt;
         app:layout_constraintRight_toRightOf=&amp;quot;parent&amp;quot;&lt;br /&gt;
         app:layout_constraintTop_toTopOf=&amp;quot;parent&amp;quot; /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/androidx.constraintlayout.widget.ConstraintLayout&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==AndroidManifest.xml==&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;manifest xmlns:android=&amp;quot;http://schemas.android.com/apk/res/android&amp;quot;&lt;br /&gt;
     package=&amp;quot;itts.onno.hms.videoplayer2&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
     &amp;lt;application&lt;br /&gt;
         android:allowBackup=&amp;quot;true&amp;quot;&lt;br /&gt;
         android:icon=&amp;quot;@mipmap/ic_launcher&amp;quot;&lt;br /&gt;
         android:label=&amp;quot;@string/app_name&amp;quot;&lt;br /&gt;
         android:roundIcon=&amp;quot;@mipmap/ic_launcher_round&amp;quot;&lt;br /&gt;
         android:supportsRtl=&amp;quot;true&amp;quot;&lt;br /&gt;
         android:theme=&amp;quot;@style/Theme.Videoplayer2&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;activity&lt;br /&gt;
             android:name=&amp;quot;.MainActivity&amp;quot;&lt;br /&gt;
             android:exported=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;intent-filter&amp;gt;&lt;br /&gt;
                 &amp;lt;action android:name=&amp;quot;android.intent.action.MAIN&amp;quot; /&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
                 &amp;lt;category android:name=&amp;quot;android.intent.category.LAUNCHER&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/intent-filter&amp;gt;&lt;br /&gt;
         &amp;lt;/activity&amp;gt;&lt;br /&gt;
     &amp;lt;/application&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/manifest&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==MainActivity.java==&lt;br /&gt;
&lt;br /&gt;
 package itts.onno.hms.videoplayer2;&lt;br /&gt;
 &lt;br /&gt;
 import androidx.appcompat.app.AppCompatActivity;&lt;br /&gt;
 import android.os.Bundle;&lt;br /&gt;
 import android.app.Activity;&lt;br /&gt;
 import android.app.ProgressDialog;&lt;br /&gt;
 import android.content.res.Configuration;&lt;br /&gt;
 import android.media.MediaPlayer;&lt;br /&gt;
 import android.media.MediaPlayer.OnPreparedListener;&lt;br /&gt;
 import android.net.Uri;&lt;br /&gt;
 import android.os.Bundle;&lt;br /&gt;
 import android.util.Log;&lt;br /&gt;
 import android.view.Menu;&lt;br /&gt;
 import android.view.MenuItem;&lt;br /&gt;
 import android.view.View;&lt;br /&gt;
 import android.widget.MediaController;&lt;br /&gt;
 import android.widget.Toast;&lt;br /&gt;
 import android.widget.VideoView;&lt;br /&gt;
 &lt;br /&gt;
 public class MainActivity extends AppCompatActivity {&lt;br /&gt;
 &lt;br /&gt;
     VideoView simpleVideoView;&lt;br /&gt;
     MediaController mediaControls; &lt;br /&gt;
 &lt;br /&gt;
     @Override&lt;br /&gt;
     protected void onCreate(Bundle savedInstanceState) {&lt;br /&gt;
         super.onCreate(savedInstanceState);&lt;br /&gt;
         setContentView(R.layout.activity_main);&lt;br /&gt;
         // Find your VideoView in your video_main.xml layout&lt;br /&gt;
         simpleVideoView = (VideoView) findViewById(R.id.simpleVideoView); &lt;br /&gt;
 &lt;br /&gt;
         if (mediaControls == null) {&lt;br /&gt;
             // create an object of media controller class&lt;br /&gt;
             mediaControls = new MediaController(MainActivity.this);&lt;br /&gt;
             mediaControls.setAnchorView(simpleVideoView);&lt;br /&gt;
         }&lt;br /&gt;
         // set the media controller for video view&lt;br /&gt;
         simpleVideoView.setMediaController(mediaControls);&lt;br /&gt;
         // set the uri for the video view&lt;br /&gt;
         simpleVideoView.setVideoURI(Uri.parse(&amp;quot;android.resource://&amp;quot; + getPackageName() + &amp;quot;/&amp;quot; + R.raw.video1));&lt;br /&gt;
         // start a video&lt;br /&gt;
         simpleVideoView.start();&lt;br /&gt;
 &lt;br /&gt;
         // implement on completion listener on video view&lt;br /&gt;
         simpleVideoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {&lt;br /&gt;
             @Override&lt;br /&gt;
             public void onCompletion(MediaPlayer mp) {&lt;br /&gt;
                 Toast.makeText(getApplicationContext(), &amp;quot;Thank You...!!!&amp;quot;, Toast.LENGTH_LONG).show(); // &lt;br /&gt;
 display a toast when an video is completed&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
        simpleVideoView.setOnErrorListener(new MediaPlayer.OnErrorListener() {&lt;br /&gt;
             @Override&lt;br /&gt;
             public boolean onError(MediaPlayer mp, int what, int extra) {&lt;br /&gt;
                 Toast.makeText(getApplicationContext(), &amp;quot;Oops An Error Occur While Playing Video...!!!&amp;quot;, Toast.LENGTH_LONG).show(); // display a toast when an error is occured while playing an video&lt;br /&gt;
                 return false;&lt;br /&gt;
             }&lt;br /&gt;
         });&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;/div&gt;</summary>
		<author><name>Unknown user</name></author>
	</entry>
</feed>