Javascript-在悬停播放视频时出现问题

时间:2019-01-21 12:32:39

标签: javascript video

<android.support.design.widget.AppBarLayout
    android:id="@+id/appBar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:elevation="4dp">

    <android.support.v7.widget.Toolbar
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        android:background="?attr/colorPrimary"
        android:id="@+id/tb"/>
</android.support.design.widget.AppBarLayout>

嘿,我只想在悬停时播放此视频。我尝试使用上述代码,但无法正常工作。你们能帮我找出造成问题的原因吗?谢谢:)

2 个答案:

答案 0 :(得分:0)

从jQuery(“。video”)删除点

jQuery("video")

答案 1 :(得分:0)

请尝试这个

$(".nb-client-video").hover(
    function() {
        $(this).find('video').play();
    }, 
    function() {
        $(this).find('video').pause();
    }
);