I loaded a local html in sdcard, and in this html I used tag :
<video id="myvideo" controls width="120" height="60" poster="img/img01.jpg" src="video/01.mp4"></video>
,然后我发现我没装这个网站,当我禁用:,在html标签工作正常,我在我的Android AVD(2.2)测试呢?
and then I found that I didn't loaded this html, when I disabled the tag:, the html was working fine, and I tested this in my android avd(2.2) ?
首先关心的编码。这是一个工作示例还有一些准则,以EN code视频对于Android的WebKit。
First of all care the encoding. Here it's an article with a working example and some guidelines to encode videos for Android webkit.
然后......当我不得不面对这个问题,我研究了一下,发现了一些有用的答案。基本上,你必须打开视频的原生浏览器的方式做
And then... when I had to face this issue, I had to research a bit and found some useful answers. Basically you have to open the video the way the native browser does
public class InredisChromeClient extends WebChromeClient implements OnCompletionListener, OnErrorListener { private InterfazWebInredis interfazWeb; // Use Your WebView instance instead private VideoView mCustomVideoView; private LinearLayout mContentView; private FrameLayout mCustomViewContainer; private WebChromeClient.CustomViewCallback mCustomViewCallback; private LinearLayout mErrorConsoleContainer; static final FrameLayout.LayoutParams COVER_SCREEN_GRAVITY_CENTER = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, Gravity.CENTER); public InredisChromeClient(InterfazWebInredis iwi) { super(); this.interfazWeb = iwi; } public void onShowCustomView(View view, CustomViewCallback callback) { // super.onShowCustomView(view, callback); if (view instanceof FrameLayout) { mCustomViewContainer = (FrameLayout) view; mCustomViewCallback = callback; mContentView = (LinearLayout) interfazWeb.findViewById(R.id.mainContainer); if (mCustomViewContainer.getFocusedChild() instanceof VideoView) { mCustomVideoView = (VideoView) mCustomViewContainer.getFocusedChild(); // frame.removeView(video); mContentView.setVisibility(View.GONE); mCustomViewContainer.setVisibility(View.VISIBLE); interfazWeb.setContentView(mCustomViewContainer); mCustomVideoView.setOnCompletionListener(this); mCustomVideoView.setOnErrorListener(this); mCustomVideoView.start(); } } } public void onHideCustomView() { if (mCustomVideoView == null) return; // Hide the custom view. mCustomVideoView.setVisibility(View.GONE); // Remove the custom view from its container. mCustomViewContainer.removeView(mCustomVideoView); mCustomVideoView = null; mCustomViewContainer.setVisibility(View.GONE); mCustomViewCallback.onCustomViewHidden(); // Show the content view. mContentView.setVisibility(View.VISIBLE); } @Override public void onCompletion(MediaPlayer mp) { mp.stop(); mCustomViewContainer.setVisibility(View.GONE); onHideCustomView(); interfazWeb.setContentView(mContentView); } @Override public boolean onError(MediaPlayer mp, int what, int extra) { interfazWeb.setContentView(R.layout.main); return true; } }
所以,这code得多灵感的android项目源$ C $浏览器了C。
和好,这种行为是开放的视频全屏。我不知道是否有可能在网页中在自己的帧播放视频。但是,这种解决方案并获得成功对我来说,我希望你也一样。
And well, the behaviour of this is opening the video full-screen. I don't know if it's possible to play the video in its own frame within the webpage. But this solution did the trick for me, I hope for you too.
问候
相关推荐
色雷斯(2023最新色雷斯百科介绍)
机动车驾驶员培训管理规定(2023最新机动车驾驶员培训管理规定百科
李世杰(清朝大臣)
阿班·贝尔格音乐作品中的回文结构(阿班·贝尔格音乐作品中的回文
张滨(张家口学院明德学院副院长)
师门使火(师门使火)
在 iOS 中发送 HTTP PATCH 请求(Objective-c)HTTP、iOS、Objectiv
在阿拉伯语中显示空白Android的谷歌地图标记称号阿拉伯语、标记、
电子名片的.vcf文件下载浏览器支持 - GoDaddy的浏览器、文件、电
起重机吊鸡毛歇后语_起重机吊鸡毛歇后语
吴昕男朋友是谁 吴昕男友个人资料曝光_吴昕男朋友是谁 吴昕男友个
考营养师需要什么条件 营养师报考条件有哪些_考营养师需要什么条
当归粉的食用方法_当归的功效与作用及食用方法
巧克力三明治的做法_三明治的做法
罗斯多少钱_火车到俄罗斯多少钱
营养食谱预防过敏,快快把它放进你的百宝箱里!_留住美丽 留驻青春的
经期能吃花胶吗_来月经可以吃花胶吗?大有裨益
冶疗肩膀颈椎酸痛的方法有哪些?_颈椎酸痛治疗方法有哪些
爱情的十种遗憾及解读_十种男性补肾壮阳的方法正确吗?
多久洗一次头发最好 洗头的注意事项(怎么护理头发_正确的护理头发
最新文章
科特勒咨询集团(2023最新科特勒咨询集团百科介绍)
南京保卫战(抗日战争时期保卫中国首都的战役)
静新图书基金(2023最新静新图书基金百科介绍)
飞来爱(中国健康文化品牌)
祖卡列特(祖卡列特)
新龙广场(盐城新龙广场)
宣州区五星乡庆丰村(宣州区五星乡庆丰村)
金麻(金麻)
尖尾枫(唇形目马鞭草科植物)
采用插入排序算法错误 - 阵列是不完全排序。阵列、不完全、算法、
女士戴戒指十个手指含义 女士戴戒指十个手指有什么含义_女生左手
关于表示学习的谚语_表示学习的谚语
黄石教育网2019年湖北黄石中考成绩查询_黄石教育网中考查分:2019年
色厉内荏的意思是什么?_色厉内荏的由来
出梅是几月几日2021_梅雨季节和出梅的意义
尿酸高吃什么营养品好呢_尿酸高吃什么好
苦瓜木耳鲫鱼的做法_凉伴苦瓜木耳的做法
逢简村攻略_逢简村历史
刮痧对皮肤到底有什么好处?_刮痧精油的功效有哪些?刮痧精油对身体有
神经衰弱的症状_女性神经衰弱的症状是什么