小编man*_*ard的帖子

通过Android WebView在YouTube HTML5视频中寻求前进

编辑 Nevermind,YouTube发布了原生Android API(https://developers.google.com/youtube/android/player/)

我有一个应用程序,通过WebView显示HTML5视频.此视频被迫通过YouTube服务获得HTML5(http://www.youtube.com/embed/3FFyT039tJ0?autoplay=1&rel=0&showinfo=0&html5=1&start=90&end=176 )

正如您在URL中看到的,参数"start"显示视频必须开始播放的秒数.我一直在使用该方法onShowCustomViewWebChromeClient获得VideoView通过的WebView创建的对象,因为看到这里.

当我有参考时VideoView,我可以使用该方法seekTo()来实现我的目标.直到这里一切都很好,但仅适用于低于4.x的Android版本.

正如你们许多人知道,方法onShowCustomViewWebViewChromeClient,从4.x和前进,当用户点击"全屏"模式只调用,但在视频开始时不打(如何使用是4.x版之前).

所以,重点是我不能向前寻求90秒,因为我无法获得对VideoView的引用,我找不到任何解决方法.

youtube video html5 android

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

内容提供商不在Nexus系列设备上工作

我正在开发一个带有ContentProvider的应用程序来提供一些内部文件(二进制文件).当我将它部署在三星Galaxy S,SII或其他任何产品上时,它可以完美地工作,当我在Galaxy Nexus或Nexus S上试用它时,它不起作用!

场景:

可以使用两个URI访问我的ContentProvider.根据此URI,提供程序将创建DataCursor(扩展CrossProcessCursor)或ModelCursor(也扩展CrossProcessCursos).事实是,在Nexus系列中,我访问第一个游标(DataCursor)来检索标识符,它工作正常,但是当访问第二个时,它总是在尝试时抛出"OutOfBoundsException"

getBlob()

方法.

提供商

@Override
    public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
        Cursor cursor = null;

        // If the third app requieres DATA (phrase id, phrase string and phrase name)
        if(uri.toString().equalsIgnoreCase(ProviderConstants.DATA_URI.toString())) {
            // Build the DataHelper and the customized cursor
            DataHelper dataHelper = new DataHelper(getContext());
            cursor = new DataCursor(dataHelper);
        } else if(uri.toString().equalsIgnoreCase(ProviderConstants.MODEL_URI.toString())) {            
            // Let's take the model id from the selectionArgs...
            if (selectionArgs != null && selectionArgs.length > …
Run Code Online (Sandbox Code Playgroud)

android android-contentprovider google-nexus

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