gpt4 book ai didi

javascript - Cordova播放html5视频

转载 作者:行者123 更新时间:2023-11-28 05:30:58 30 4
gpt4 key购买 nike

我使用 cordova 构建混合标牌应用程序。当我尝试显示视频时,我需要在屏幕的一部分上显示视频,但除了声音之外看不到任何视频。当我全屏显示视频时没有问题。但我需要将其显示在屏幕的一部分上,例如 width: 400px height:400px top:100px left:100px

<video 
id="videoContent_0" src="file:///storage/emulated/0/DS/MediaFiles/1004.mp4" autoplay="" style="z-index: 100; display: inline-block;">
</video>

最佳答案

使用 cordova 插件的更好解决方案,然后您可以获得想要的结果。

Installation

cordova plugin add com.moust.cordova.videoplayer

Using: Just call the play method with a video file path as argument. The video player will close itself when the video will be completed.

VideoPlayer.play(
"file:///android_asset/www/movie.mp4",
{
volume: 0.5,
scalingMode: VideoPlayer.SCALING_MODE.SCALE_TO_FIT_WITH_CROPPING
},
function () {
console.log("video completed");
},
function (err) {
console.log(err);
}
);

关于javascript - Cordova播放html5视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39706547/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com