Back to project page AdvancedPlayer.
The source code is released under:
Apache License
If you think the Android project AdvancedPlayer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.huilan.library_videoplay.sample; /*from w w w .j a va 2s .co m*/ import android.content.Intent; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.Button; import com.huilan.library_videoplay.AdvancedPlayer; import com.huilan.library_videoplay.AdvancedPlayerSimple; import com.huilan.library_videoplay.VideoViewPlay; public class MainActivity extends ActionBarActivity implements View.OnClickListener { private Button videoPlay; private Button advancedplayer; private Button other; private Button advancedPlayerSimple; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); intId(); } private void intId() { videoPlay = (Button) findViewById(R.id.btn_videoViewPlay); advancedplayer = (Button) findViewById(R.id.btn_advancedplayer); other = (Button) findViewById(R.id.btn_other); advancedPlayerSimple = (Button) findViewById(R.id.btn_videoViewPlaySimple); videoPlay = (Button) findViewById(R.id.btn_videoViewPlay); videoPlay = (Button) findViewById(R.id.btn_videoViewPlay); videoPlay.setOnClickListener(this); advancedplayer.setOnClickListener(this); advancedPlayerSimple.setOnClickListener(this); other.setOnClickListener(this); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } @Override public void onClick(View v) { Intent intent; switch (v.getId()) { case R.id.btn_videoViewPlay: intent = new Intent(getApplication(), VideoViewPlay.class); // intent.putExtra("url","http://202.108.17.115/v.cctv.com/flash/mp4video32/TMS/2014/02/12/b32eaf65cc07489aabc748a37bfd4b4b_h264418000nero_aac32.mp4"); // intent.putExtra("url","http://2014.lsz.gov.cn/app/spj/1270865/index.html"); intent.putExtra("url", "http://www.lsz.gov.cn/eportal/ui?pageId=1237008&articleKey=1425104&columnId=1271181"); intent.putExtra("regex", "(/eportal/immovableDir/lszrmzf/resource/cms/)(.{0,50})\\.flv"); startActivity(intent); break; case R.id.btn_advancedplayer: intent = new Intent(getApplication(), AdvancedPlayer.class); intent.putExtra("url", "http://bcs.duapp.com/myvideovip/media/20141023.mp4"); // intent.putExtra("url", "/sdcard/20141023.mp4"); // intent.putExtra("regex", "http://www.iplaysoft.com/"); // intent.putExtra("url", "http://www.lsz.gov.cn/eportal/ui?pageId=1237008&articleKey=1425104&columnId=1271181"); // intent.putExtra("regex", "(/eportal/immovableDir/lszrmzf/resource/cms/)(.{0,50})\\.flv"); startActivity(intent); break; case R.id.btn_videoViewPlaySimple: // intent = new Intent(getApplication(), AdvancedPlayerSimple.class); intent = new Intent(getApplication(), AdvancedPlayer.class); intent.putExtra("url", "http://bcs.duapp.com/myvideovip/media/20141023.mp4"); // intent.putExtra("url", "/sdcard/20141023.mp4"); // intent.putExtra("regex", "http://www.iplaysoft.com/"); startActivity(intent);//AdvancedPlayer>> break; case R.id.btn_other: intent = new Intent(getApplication(), TextActivity.class); startActivity(intent); break; } } }