小编Rob*_*eel的帖子

Vimeo视频停止在Android 6设备上播放

我正试图在我的应用程序中播放Vimeo的视频.问题是在Android 6设备上,视频会在一段时间后停止播放.在具有较低API的设备上,一切都很好.

  • 时间取决于质量.对于下面提供的网址的视频播放一定的分钟(1到3).视频质量越低,播放时间越长.
  • 1到3分钟后,媒体播放器抛出ProtocolException.该应用程序不会崩溃,但视频会在播放缓冲的视频片段时冻结.[MediaHTTPConnection] readAt 25182208 / 32768 => java.net.ProtocolException: unexpected end of stream and shows this in de log
  • 在异常之后视频播放30秒(缓冲),然后应用程序输出此信息 [MediaPlayer] error (1, -1004)

我们现在通过Vimeo支持向他们发送电子邮件数周,但他们无法提供解决方案或可能的原因.现在经过几周的邮寄后,支持部门表示他们不支持Android,但我们已经尝试了他们的建议:

  • 使用重定向和未重定向的URL

http://player.vimeo.com/external/185069251.hd.mp4?s=fd7b4178a59166b3f636f2e48f1d49b99db66ed2&profile_id=174 [重定向网址]

https://fpdl.vimeocdn.com/vimeo-prod-skyfire-std-us/01/2013/7/185069251/610514667.m​​p4?token=586a9287_0xbb25f73405c612b30e0c64dc4c3a169e30137f84 [未重定向的URL]

  • 使用视频视图而不是媒体播放器

  • 我们尝试过原生Android和Xamarin Android实现

  • 尝试下载文件=>这是有效的,但我们想要流,因为一些视频超过30分钟(> 100mb).取消注释DownLoadActivity中onCreate中的代码以测试下载.

在浏览器中一切正常.

我在We-Transfer上放置了一个测试项目,你可以看到问题https://bazookas.wetransfer.com/downloads/40dadcc8a01f7ebf025345cdf88b731220170102160508/21970a

android vimeo vimeo-android

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

将appbarLayout放在屏幕底部

问题 是否可以在屏幕底部放置AppBarLayout?

问题 我正在尝试在屏幕底部放置一个条形,当我向下滚动时滚动离开,当我向上滚动时出现.因为协调器布局和appbarlayout帮助我在顶部有工具栏的其他活动中执行此操作,我想在我的按钮栏上尝试这个.

这是我的xml.

<?xml version="1.0" encoding="utf-8"?>
    <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:id="@+id/coordinatorLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <MyNameSpace.Views.ScrollViews_Custom.ScrollView_Base
            android:id="@+id/scrollview_movieDetail"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:overScrollMode="never"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />
        <android.support.design.widget.AppBarLayout
            android:id="@+id/appBarLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <LinearLayout
                android:id="@+id/bar_movieDetail_buttom"
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:orientation="vertical"
                android:background="@color/actionbar_gray_transparent"
                android:animateLayoutChanges="true">
            </LinearLayout>
        </android.support.design.widget.AppBarLayout>
    </android.support.design.widget.CoordinatorLayout>
Run Code Online (Sandbox Code Playgroud)

android android-layout

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

在Hint,TextInputLayout上设置自定义字体

我试图设置自定义字体上HintTextInputLayout.因此我使用自TextInputLayout定义属性的自定义子类MyHint.此属性设置器应格式化文本并设置FormattedText但不起作用.

如果我只是设置FormattedHint属性它也不格式化.有谁为什么这些方法失败了?

下面你可以看到我的自定义类属性.

例:

BaseTextInputLayout userNameInput = view.FindViewById<BaseTextInputLayout>(Resource.Id.myId);
userNameInput.MyHint = "My Custom hint text";
Run Code Online (Sandbox Code Playgroud)

类:

   public class BaseTextInputLayout: TextInputLayout
    {
        public string MyHint
        {
            get
            {
                return Hint;
            }
            set { 
                if (value != null)
                {
                    SpannableStringBuilder builder = new SpannableStringBuilder(value);
                    builder.SetSpan(new CustomTypeFaceSpan("", Constants_Android.TYPEFACE_YOGA_MET_EVY_CUSTOMFONT), 0, builder.Length(), SpanTypes.InclusiveExclusive);
                    this.HintFormatted = builder;
                }
                else
                {
                    this.HintFormatted = null;
                }
            }
        }
Run Code Online (Sandbox Code Playgroud)

android xamarin textinputlayout

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

在viewholder中查看不更新(不占用高度)

我有一个配置为的视图wrap_content.在该视图中,如果用户未登录,我会显示一个视图.此视图被夸大为ViewStub.

在屏幕上的第一个单元格中,一切都很好.但是,如果我滚动到屏幕外的单元格,那就错了.这个观点没有达到他的高度.

在第三个单元格android:id="@+id/background"View_NoLoggedInView(那个中的那个ViewStub)没有达到他的高度.

我删除了不相关的代码,使类和布局更具可读性.

有谁知道为什么第三个细胞只有在他离开屏幕然后再次进入时才会更新,我怎么能解决这个问题?

在这里你可以找到像gif一样的视觉问题:

在此输入图像描述

Viewholder AXML布局:

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/flickrList_red">
    <ViewStub
        android:id="@+id/noLoggedInViewInclude"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout="@layout/View_NoLoggedInView" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

膨胀的View_NoLoggedInView viewstub布局Axml代码:

    <?xml version="1.0" encoding="utf-8"?>
<Kvo.Droid.View_NoLoggedInView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clickable="true">
    <View
        android:id="@+id/background"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:alpha="0.75"
        android:background="@android:color/black" />
    <RelativeLayout
        android:id="@+id/whiteCard"
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:layout_marginLeft="30dp"
        android:layout_marginRight="30dp"
        android:layout_marginTop="10dp"
        android:layout_marginBottom="10dp"
        android:background="@drawable/whitecard">
        <ImageView
            android:id="@+id/lockIcon"
            android:layout_width="30dp"
            android:layout_height="30dp"
            android:scaleType="centerInside"
            android:layout_centerVertical="true"
            android:layout_marginLeft="20dp"
            android:src="@mipmap/lock" />
        <MobileFans.Base.Droid.BaseTextView
            android:id="@+id/contentText"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dp"
            android:layout_marginRight="20dp"
            android:layout_marginTop="20dp"
            android:layout_marginBottom="20dp" …
Run Code Online (Sandbox Code Playgroud)

android viewstub android-layout android-viewholder

6
推荐指数
0
解决办法
202
查看次数