小编Bas*_*eer的帖子

如何在一个活动中在不同的视频视图中播放多个视频

示例代码:

如何在一个活动中播放这两个视频

public class Two_videos extends Activity 
{
VideoView video1, video2;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.two_video);

VideoView video1= (VideoView) findViewById(R.id.video1);
              video1.setVideoPath("/mnt/sdcard/Movies/com.bnb.giggle/IMG_20130415184609.mp4");
            video1.start();

VideoView video2= (VideoView) findViewById(R.id.video2);
        video2.setVideoPath("/mnt/sdcard/Movies/com.bnb.giggle/IMG_20130415184608.mp4");
        video2.start();
   }
}
Run Code Online (Sandbox Code Playgroud)

不能同时播放两个视频.

android android-videoview

5
推荐指数
1
解决办法
2万
查看次数

如何在Android中将文件转换为base 64(如.pdf,.txt)?

如何将SD卡文件(.pdf,.txt)转换为基本64字符串和字符串发送到服务器

java base64 android

5
推荐指数
2
解决办法
1万
查看次数

如何在android中停止Webview视频

在我的项目中使用webview使用iframe概念加载视频网址,但是调用下一个网页无法停止播放声音或暂停视频.或任何其他编码用于在webview中搜索视频

我的代码:

public class Webviewfullscreen extends Activity {

    WebView webview;
    LinearLayout webViewPlaceholder;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.webviewfull);
        webViewPlaceholder=(LinearLayout) findViewById(R.id.webViewholder);
        String VideoUrl=this.getIntent().getExtras().getString("url");
        webview = (WebView) findViewById(R.id.webView1);
        webViewDisplay(VideoUrl, webview);
    }
    private void webViewDisplay(final String weburl, final WebView www) {
        new Handler().post(new Runnable() {
            @SuppressWarnings("deprecation")
            @Override
            public void run() {

                WebSettings settings = www.getSettings();
                String Url = "<html> <head> <style type=text/css> iframe {height:100%;width:100%;margin:0;padding:0;overflow:scroll;} body {background-color:#000; margin:0;}</style> </head> <body> <iframe width=240px height=220px src="
                        + weburl
                        + …
Run Code Online (Sandbox Code Playgroud)

java android android-webview

3
推荐指数
1
解决办法
5662
查看次数

如何使用post方法将一个关键字中的字符串数组值发送到服务器

我正在使用此代码,但我无法发送字符串数组:

httpclient = new DefaultHttpClient();
httppost = new HttpPost(Call_Server.UPLOAD_VIDEO);
MultipartEntity mpEntity = new MultipartEntity(
        HttpMultipartMode.STRICT);
mpEntity.addPart("FILE_UPLOAD", new FileBody(videofile));
mpEntity.addPart("from_email", new StringBody(
        Call_Server.useremail));
mpEntity.addPart("recipient_emails", new StringBody(
        AddressArray));

httppost.setEntity(mpEntity);


HttpResponse response = httpclient.execute(httppost);

HttpEntity resEntity = response.getEntity();
Run Code Online (Sandbox Code Playgroud)

java android

1
推荐指数
1
解决办法
5105
查看次数