1.如何用js控制h5视频到一定时间停止
如何用js控制h5视频到一定时间停止
可以通过 Native.js 实现,动态动态通过设置 android.intent.extra.durationLimit 来限定录像时间。时间时间语音交友源码出售
<button id="btn" type="button" class="mui-btn mui-btn-blue mui-btn-block">按钮</button><script type="text/javascript">
document.querySelector('#btn').addEventListener('click',停止停止centos php 源码安装mysqlfunction () {
// 调用原生android摄像头
var VIDEOZOOM = ;
var MediaStore = plus.android.importClass("android.provider.MediaStore");
var Intent = plus.android.importClass("android.content.Intent");
// 导入后可以使用new方法创建类的示例对象
var intent = new Intent("android.media.action.VIDEO_CAPTURE");
intent.putExtra("android.intent.extra.videoQuality", 1);//0 means low quality, 1 means high quality
//intent.putExtra("android.provider.MediaStore.EXTRA_OUTPUT", url);
intent.putExtra("android.intent.extra.durationLimit", 3);//设置录像时间
var main = plus.android.runtimeMainActivity();
main.startActivityForResult(intent,VIDEOZOOM);
//获取返回参数
main.onActivityResult = function(requestCode, resultCode, data) {
var context = main;
plus.android.importClass(data);
var uri = data.getData();
var resolver = context.getContentResolver();
plus.android.importClass(resolver);
var cursor = resolver.query(uri, null, null, null, null);
plus.android.importClass(cursor);
cursor.moveToFirst();
var column = cursor.getColumnIndexOrThrow(MediaStore.Video.Media.DATA);
// 获取录制的视频路径
var filePath = cursor.getString(column);
// 解析视频文件的属性
plus.io.resolveLocalFileSystemURL(filePath,function(entry) {
entry.file(function(file){
console.log("size=="+file.size);
console.log("name=="+file.name);
});
}, function (e) {
console.log("Resolve file URL failed: " + e.message);
});
};
})</script>
2024-11-17 09:50
2024-11-17 09:18
2024-11-17 09:12
2024-11-17 09:10
2024-11-17 08:52
2024-11-17 08:19
2024-11-17 08:08
2024-11-17 08:03