0

I am embedding mediaplayer in webview using HTML5.

<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>

The above is my html5, but when i load, mediaplayer was not get embed.

I got some suggestion from Google, it says,we need to include<audio/video> tag for to embed the multimedia file in html5 for android.

I must to include the audio/video tag or the above html itself can work.

Please help me out. Thanks in advance.

user3064914
  • 921
  • 1
  • 7
  • 18
RAAAAM
  • 3,378
  • 19
  • 59
  • 108

2 Answers2

0

use video tag to play for html5 in android

<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>
Nambi
  • 11,944
  • 3
  • 37
  • 49
  • does video tag can play both audio and video format? but why the embed not working for android. i tried to load in several devices, but none will support. – RAAAAM Jan 17 '14 at 07:42
  • did you enabled javascript in the webview settings – Nambi Jan 17 '14 at 07:46
  • No, i dint enable javaScript for webview. incase if i enable the javascrit, will my webview can embed the mediaplayer. – RAAAAM Jan 17 '14 at 07:54
0

you should Add webChromeClient to webview and override onShowCustomView(View view,CustomViewCallback callback).

Sush
  • 3,864
  • 2
  • 17
  • 35