无法使用android系统中的MediaController暂停/快进/后退视频 [英] Unable to pause/forward/backward video using mediacontroller in android

查看:1295
本文介绍了无法使用android系统中的MediaController暂停/快进/后退视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

荫使用无法暂停/快进/后退视频的MediaController ,它是只发生在LG的设备。下面是code这我使用,它是工作中的所有设备的其余部分:

Iam unable to pause / forward / backward the video using MediaController and it is happening only in the LG devices. Below is the code which am using and it is working in the rest of all the devices :

    VideoView video=(VideoView)findViewById(R.id.video);
    MediaController mediaController = new MediaController(this);
    mediaController.setAnchorView(video);
    video.setMediaController(mediaController);
    video.setVideoURI(uri);
    video.start();

请帮我在这。

推荐答案

最后,我找到了解决办法...

Finally I found a solution...

在一些LG的设备,通过defaultly控制是VideoView禁用。

In some LG devices, by defaultly controls are disabled in VideoView.

因此​​,我们必须在VideoView覆盖以下功能明确启用它们:

So we have to explicitly enable them by Overriding the below functions in VideoView:

@Override
public boolean canSeekForward() {
    return true;
}

@Override
public boolean canSeekBackward() {
    return true;
}

@Override
public boolean canPause() {
    return true;
}

这篇关于无法使用android系统中的MediaController暂停/快进/后退视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆