2014-01-17 98 views
0

我使用HTML5在webview中嵌入mediaplayer。如何在webview中嵌入mediaplayer - android

<p> 
<img alt="" src="image7_jpg.jpg" style="height:262px; width:350px" /> 
test video<object width="160" height="144"><param name="autoplay" value="false"> 
<embed src="videoSample.3gp" width="160" height="144" autoplay="false" 
controller="false"> </embed></p> 

以上是我html5,但是當我加載,媒體播放器並沒有得到嵌入。

我收到了Google的一些建議,它說,我們需要包含<audio/video>標籤,以便爲android嵌入html5多媒體文件。

我必須包含audio/video標記或上面的html本身才能工作。

請幫我一把。提前致謝。

回答

0

使用視頻標籤在安卓

<video id="video-example" width="256" height="177" poster="image7_jpg.jpg"> 
<source src="videoSample.3gp" type="video/3gp"></source> 
This browser does not support HTML5 
</video> 
+0

視頻標籤可以播放音頻和視頻格式嗎?但爲什麼嵌入式不適用於android。我試圖加載幾個設備,但沒有人會支持。 – RAAAAM

+0

您是否在webview設置中啓用了javascript – Nambi

+0

不,我爲webview啓用了javaScript。如果我啓用javascrit,請將我的webview嵌入mediaplayer。 – RAAAAM

0

html5你應該添加webChromeClient到的WebView和覆蓋onShowCustomView(View view,CustomViewCallback callback)