Tuesday, April 10, 2012

Phonegap Android Webview Video plays only audio

I've started to play around with phonegab today. When I was trying to capture video its working fine. Now I wanna show the captured video in the webview. so I was trying as below.

var captureSuccess = function(mediaFiles) {
var i, path, len;
for (i = 0, len = mediaFiles.length; i < len; i += 1) {
path = mediaFiles[i].fullPath;
videoString = "<video width='320' height='240' controls='controls'><source src="+path+" type='video/mp4' /> <source src="+path+" type='video/ogg' /> <source src="+path+" type='video/webm' />Your browser does not support the video tag.</video>";


// capture error callback
var captureError = function(error) {
navigator.notification.alert('Error code: ' + error.code, null, 'Capture Error');

// start video capture
function takeVideo(){
navigator.device.capture.captureVideo(captureSuccess, captureError, {limit:1});

but in the UI I see the player being appended but it plays only the audio not the video.. wot could be the problem.??

Any help appreciated and thanks for your time in advance.

No comments:

Post a Comment