简体   繁体   English

Android HTML5视频问题

[英]Android HTML5 video issue

I am using HTML5 video tag to play an online video on Samsung tablet with android 5.0, but some issues come up. 我正在使用HTML5视频标签在装有android 5.0的三星平板电脑上播放在线视频,但是出现了一些问题。 And it works fine on iOS. 而且它在iOS上运行良好。

 <video id='video-widget' autoplay='true'  preload autobuffer controls style="width:100%;">
        <source src="{{src}}">
    </video>


.video-widget-container {
    height: 469px;
    width: 100%;
    margin-top: 100px;
}

.video-widget-container video::-webkit-media-controls-overlay-play-button
    {
    display: none;
    -webkit-appearance: none;
}

.video-widget-container video::-webkit-media-controls-panel {
    /*  display: block !important;
    -webkit-appearance:  button; */

}

.video-widget-container video::-webkit-media-controls-play-button {
    /*      display: block !important;
    -webkit-appearance:  button;  */

}

.video-widget-container.loading video::-webkit-media-controls-play-button
    {
    display: none !important;
    -webkit-appearance: none;
}

#video-widget.loading video::-webkit-media-controls-play-button {
    display: none !important;
    -webkit-appearance: none;
}

.video-widget-container video::-webkit-media-controls-start-playback-button
    {
    display: none !important;
    -webkit-appearance: none;
}

.video-widget-container video::-webkit-media-controls-enclosure {
    /*  display: block !important;
     -webkit-appearance:  button; */

}



.video-widget-container video {
    background: transparent url('../images/video/CVE_MAP.svg') no-repeat 0 0;
    -webkit-background-size: 100% 100%;
    -moz-background-size: 100% 100%;
    -o-background-size: 100% 100%;
    background-size: 100% 100%;
}
  1. the video does not autoplay although I have set autoplay; 我设置了自动播放,但视频无法自动播放;

  2. there is an ugly big play button along with the poster I set, as seen in the picture1 the world map is my poster ; 我设置的海报旁边有一个难看的大播放按钮,如图1所示,世界地图是我的海报;

  3. how can I hide the default play button in code ? 如何隐藏代码中的默认播放按钮?

图片1

It is the poster's issue. 这是海报的问题。 I think if the poster is not set in code. 我认为如果海报未设置代码。 The webview would set a default one for the video tag. Web视图将为视频标签设置默认视图。 So I set the value of poster as 'null'. 因此,我将poster的值设置为“ null”。 It is ok. 没关系。

I am successfully playing video on Android 4.2.2 , 4.3 , 4.4.4 , 5.0 , 5.1 . 我成功地玩视频Android 4.2.24.34.4.45.05.1 solution: 解:

  • Install crosswalk 安装人行横道

  • Tell angular to trust the URL $scope.vidURL = $sce.trustAsResourceUrl(data.vidURL); 告诉angular信任URL $scope.vidURL = $sce.trustAsResourceUrl(data.vidURL);

  • Wrap the video element in a div with data-tap-disable="true" 使用data-tap-disable="true"将div中的video元素包装起来

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM