要以缩略图显示的视频?

时间:2013-05-06 07:56:39

标签: android text video-thumbnails

我是android新手.. 如何在ListView行中显示带有文本的视频缩略图?

我在我的数据库(服务器)中存储了一组youtube网址。通过使用AsyncTask我检索了url并存储在数组字符串中... 现在在onPostExecute方法..如何在列表视图中显示这个数组视频网址?

如何实现这个??

class LoadFiles extends AsyncTask<String, String, String> {
    @Override
    protected void onPreExecute() {
        super.onPreExecute();
        pDialog = new ProgressDialog(Focusarea.this);
        pDialog.setMessage("Loading Videos. Please wait...");
        pDialog.setIndeterminate(false);
        pDialog.setCancelable(false);
        pDialog.show();
    }
      protected String doInBackground(String... args) {
        List<NameValuePair> params = new ArrayList<NameValuePair>();
        params.add(new BasicNameValuePair("name", name));
        json = jsonParser.makeHttpRequest(url_geturl, "GET", params);           
    Log.d("All Groups: ", json.toString());
    try {
        int success = json.getInt(TAG_SUCCESS);
        System.out.println("Success");
        if (success == 1) {
            System.out.println("Success");   
            groups = json.getJSONArray(TAG_GROUP);
            System.out.println("Result Success+++"+groups);
            for (int i = 0; i < groups.length(); i++) {
            JSONObject c = groups.getJSONObject(i);
                String intro = c.getString(TAG_INTRO);
                System.out.println("Checking ::"+intro);
                                vid.add(intro);
                System.out.println("VIDEOS LINK" + vid);
                if(intro!=null && intro!=""){
                    videoUrl=intro;
                }else {
                    showAlert();
                }
                            } catch (JSONException e) {
        System.out.println("Error "+e.toString());
            }
        return null;
          }
               protected void onPostExecute(String file_url) {
        // dismiss the dialog after getting VIDEOS
        pDialog.dismiss();  
        vid=new ArrayList<String>(new ArrayList<String>(vid));
           // how to implement here...
                }
             }

1 个答案:

答案 0 :(得分:1)

1)AsyncTasks,首先下载图像,存储到缓存中,然后显示在onPostExecute方法上。随后从缓存中获取图像。

2)Nostra的Universal Image Loader

3)Fedor的LazyList。和;

4)Novoda的ImageLoader