資源簡介
ts推流工具,udp推流工具,內(nèi)附實(shí)用的使用說明書.....

代碼片段和文件信息
package?com.amlogic.switchchannel;
import?android.app.Activity;
import?android.net.Uri;
import?android.os.Bundle;
import?android.view.KeyEvent;
import?android.view.Menu;
import?android.view.MotionEvent;
import?android.widget.Toast;
import?android.widget.VideoView;
public?class?MainActivity?extends?Activity
{
public?static?String[]?url?=?new?String[3];
{
url[0]?=?“udp://@239.1.1.1:10001“;
url[1]?=?“udp://@239.1.1.1:10002“;
url[2]?=?“udp://@239.1.1.1:10003“;
}
private?VideoView?video?=?null;
private?int?chanelIndex?=?0;
@Override
protected?void?onCreate(Bundle?savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
video?=?(VideoView)?findViewById(R.id.video);
video.setVideoURI(Uri.parse(url[chanelIndex]));
//String?uuu?=?“http://221.181.100.149/3000120541.m3u8?stbId=004401FF002100701326002468C005A5&Contentid=5068253659616166748&livemode=2&starttime=20140416T160000.00Z&channel-id=wasusyt“;
//video.setVideoURI(Uri.parse(uuu));
video.start();
}
@Override
public?boolean?onCreateOptionsMenu(Menu?menu)
{
//?Inflate?the?menu;?this?adds?items?to?the?action?bar?if?it?is?present.
getMenuInflater().inflate(R.menu.main?menu);
return?true;
}
public?boolean?onkeydown(int?keyCode?KeyEvent?event)
{
if?(keyCode?==?KeyEvent.KEYCODE_DPAD_UP)
{
backChannel();
Toast.makeText(this?chanelIndex+“?url:?“+url[chanelIndex]?Toast.LENGTH_LONG).show();
//video.seekTo(1000);
//Toast.makeText(this?“seekTo?:1000“?Toast.LENGTH_LONG).show();
}
else?if?(keyCode?==?KeyEvent.KEYCODE_DPAD_DOWN)
{
nextChannel();
Toast.makeText(this?chanelIndex+“?url:?“+url[chanelIndex]?Toast.LENGTH_LONG).show();
//video.seekTo(20000);
//Toast.makeText(this?“seekTo?:20000“?Toast.LENGTH_LONG).show();
}
return?super.onkeydown(keyCode?event);
}
@Override
public?boolean?onTouchEvent(MotionEvent?event)?{
//?TODO?Auto-generated?method?stub
if(event.getAction()?==?MotionEvent.ACTION_DOWN){
nextChannel();
Toast.makeText(this?chanelIndex+“?url:?“+url[chanelIndex]?Toast.LENGTH_LONG).show();
}
return?super.onTouchEvent(event);
}
private?void?nextChannel(){
chanelIndex?=?(chanelIndex?+?1)?%?3;
video.setVideoURI(Uri.parse(url[chanelIndex]));
video.start();
}
private?void?backChannel(){
chanelIndex?=?(chanelIndex?+?3?-?1)?%?3;
video.setVideoURI(Uri.parse(url[chanelIndex]));
video.start();
}
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-07-09?12:59??TSFileSender\
?????文件???????28672??2010-09-10?10:39??TSFileSender\DVTReTran.dll
?????目錄???????????0??2018-07-09?12:59??TSFileSender\SwitchChannel\
?????文件?????????328??2015-02-15?15:11??TSFileSender\SwitchChannel\Android.mk
?????文件????????1036??2015-02-15?15:13??TSFileSender\SwitchChannel\AndroidManifest.xm
?????目錄???????????0??2018-07-09?13:02??TSFileSender\SwitchChannel\assets\
?????目錄???????????0??2018-07-09?12:59??TSFileSender\SwitchChannel\libs\
?????文件??????484258??2014-03-08?17:06??TSFileSender\SwitchChannel\libs\android-support-v4.jar
?????目錄???????????0??2018-07-09?12:59??TSFileSender\SwitchChannel\res\
?????目錄???????????0??2018-07-09?12:59??TSFileSender\SwitchChannel\res\drawable-hdpi\
?????文件????????7658??2014-03-08?17:06??TSFileSender\SwitchChannel\res\drawable-hdpi\ic_launcher.png
?????目錄???????????0??2018-07-09?13:02??TSFileSender\SwitchChannel\res\drawable-ldpi\
?????目錄???????????0??2018-07-09?12:59??TSFileSender\SwitchChannel\res\drawable-mdpi\
?????文件????????3777??2014-03-08?17:06??TSFileSender\SwitchChannel\res\drawable-mdpi\ic_launcher.png
?????目錄???????????0??2018-07-09?12:59??TSFileSender\SwitchChannel\res\drawable-xhdpi\
?????文件???????12516??2014-03-08?17:06??TSFileSender\SwitchChannel\res\drawable-xhdpi\ic_launcher.png
?????目錄???????????0??2018-07-09?12:59??TSFileSender\SwitchChannel\res\drawable-xxhdpi\
?????文件???????24777??2014-03-08?17:06??TSFileSender\SwitchChannel\res\drawable-xxhdpi\ic_launcher.png
?????目錄???????????0??2018-07-09?12:59??TSFileSender\SwitchChannel\res\layout\
?????文件?????????412??2014-03-08?17:13??TSFileSender\SwitchChannel\res\layout\activity_main.xm
?????目錄???????????0??2018-07-09?12:59??TSFileSender\SwitchChannel\res\menu\
?????文件?????????263??2014-03-08?17:06??TSFileSender\SwitchChannel\res\menu\main.xm
?????目錄???????????0??2018-07-09?12:59??TSFileSender\SwitchChannel\res\values\
?????文件?????????220??2014-03-08?17:06??TSFileSender\SwitchChannel\res\values\dimens.xm
?????文件?????????230??2015-02-15?15:28??TSFileSender\SwitchChannel\res\values\strings.xm
?????文件?????????697??2014-03-08?17:06??TSFileSender\SwitchChannel\res\values\st
?????目錄???????????0??2018-07-09?12:59??TSFileSender\SwitchChannel\res\values-sw600dp\
?????文件?????????203??2014-03-08?17:06??TSFileSender\SwitchChannel\res\values-sw600dp\dimens.xm
?????目錄???????????0??2018-07-09?12:59??TSFileSender\SwitchChannel\res\values-sw720dp-land\
?????文件?????????277??2014-03-08?17:06??TSFileSender\SwitchChannel\res\values-sw720dp-land\dimens.xm
?????目錄???????????0??2018-07-09?12:59??TSFileSender\SwitchChannel\res\values-v11\
............此處省略15個(gè)文件信息
評論
共有 條評論