从指定android的文件夹中播放VideoView中的视频数量

时间:2015-12-23 09:08:54

标签: java android android-videoview

我尝试使用以下代码根据指定文件夹中显示的视频数量显示VideoView。它不播放视频,只显示单个视频。请提出任何建议。

代码

File file=new File(Environment.getExternalStorageDirectory() + File.separator + "Funtube/UserData/Videos/" + File.separator);
 File[] list = file.listFiles();
 for (File f: list){
  String name = f.getName();
  if (name.endsWith(".mp4"))
   count++;
    for(int a=0;a<=count;a++)
    {
     VideoView vdos=(VideoView) findViewById(R.id.videoView);
     String path=file.getAbsolutePath()+name;
      vdos.setVideoURI(Uri.parse(path));
       vdos.start();
      }

1 个答案:

答案 0 :(得分:1)

[HttpPost]
    public async Task<AjaxResponse> Authenticate(LoginModel loginModel)
    {
        CheckModelState();

        var loginResult = await GetLoginResultAsync(
            loginModel.UsernameOrEmailAddress,
            loginModel.Password,
            loginModel.TenancyName
            );

        var ticket = new AuthenticationTicket(loginResult.Identity, new AuthenticationProperties());

        var currentUtc = new SystemClock().UtcNow;
        ticket.Properties.IssuedUtc = currentUtc;
        ticket.Properties.ExpiresUtc = currentUtc.Add(TimeSpan.FromMinutes(30));

        return new AjaxResponse(OAuthBearerOptions.AccessTokenFormat.Protect(ticket));
    }

你需要在Oncreate中初始化LinkList也添加oncomplet ..       听者