SRam
SRam

Reputation: 2828

Black screen while playing video from YouTube : Phonegap Android

I am playing a you tube video from a URL its playing and sounds is coming but on UI black screen is appearing only , but when i do video in Full screen mode then its visible ..my code are below please review it and guide me if and where i m wrong..

try{
$("#videoProdName").text(dataArr[3]+' - '+dataArr[1]);
 $("#videoProdPrice").text(dataArr[2]+" MSRP");
// $("#buyNowVideo").attr("href",dataArr[7]);
var videourl=dataArr[5]+"?autoplay=1&rel=0&showinfo=0&cc_load_policy=1";

$("#youTubeVideo").html('<iframe height="200" width="100%" src="'+videourl+'"        frameborder="0" type="text/html" frameborder="0" allowfullscreen></iframe>');
//  

$.mobile.changePage( "#video-page", {transition: "slide"});
    $("#aPageVideo").fadeTo("fast", .5);
}catch(e){alert("Exp: "+e)}

}

Thanks in advance.

Upvotes: 3

Views: 2758

Answers (3)

amalikahmad
amalikahmad

Reputation: 1

You need to put this in the config.xml file inside the res folder:

<feature name="VideoPlayer">
        <param name="android-package" value="com.phonegap.plugins.video.VideoPlayer" />  
</feature>

NOT videoplayer... VideoPlayer.... NOT <param name="VideoPlayer"... <param name="android-package"...

Upvotes: 0

Akshay Joy
Akshay Joy

Reputation: 1765

I think same issue happening in My Android Simulator, when I try to Launch the App using Tab/Phone, Video works as Expected,

If you are using PhoneGAP I advice to use HTML5 video tags for the Android Application.

Please check this Post

html5 video player

Upvotes: 0

mram888
mram888

Reputation: 5139

Try using the Phonegap YouTube's plugin to get this done:

https://github.com/remcob00/cordova-phonegap_youtube_player_api_android

Upvotes: 2

Related Questions