【问题标题】:Insert a play button (image) over a video thumbnail in Jquery Mobile + Android Webview在 Jquery Mobile + Android Webview 中的视频缩略图上插入播放按钮(图像)
【发布时间】:2013-09-12 21:50:52
【问题描述】:

我在 mySQL 数据库中有多个缩略图,例如使用这样的链接为 youtube 视频生成。

http://i1.ytimg.com/vi/1sIWez9HAbA/hqdefault.jpg

我正在使用 Android Webview 显示 Jquery Mobile 部分,缩略图是在 Jquery Mobile 中生成的。

现在我想在每个缩略图的中间插入一个播放按钮。当任何人点击缩略图时,播放按钮必须消失。

我该怎么做?有人可以帮忙吗?

【问题讨论】:

    标签: javascript android jquery webview youtube


    【解决方案1】:

    这样布局

    <RelativeLayout
        android:id="@+id/relVideo"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
    
        <ImageView
            android:id="@+id/imgVideoThumb"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:adjustViewBounds="true" />
    
         <ImageView
             android:id="@+id/imgPlayVideo"
             android:layout_width="40dp"
             android:layout_height="40dp"
             android:layout_centerInParent="true"
             android:adjustViewBounds="true"
             android:src="@drawable/video_play_btn" />
    </RelativeLayout>
    

    【讨论】:

    • 我正在使用 Jquery Mobile 和 Android Webview 在 youtube 应用程序本身中播放 youtube 视频。我只是显示缩略图,当我单击缩略图时,youtube 应用程序会打开并播放视频。但问题是在该缩略图中放置一个播放按钮。我在 mySQL 数据库中存储了多个缩略图链接,我必须为我插入的每个缩略图动态添加按钮。
    猜你喜欢
    • 2012-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多