I'm building a smartphone app in HTML5 with the help of JQueryMobile. Since I want it to retrieve a list of videos from a user on youtube I used YouTube's API to do that, after I get all that I needed with it, I made a new page exclusively for the player. When I pick the video, it redirects me to the player I have in my page(an iframe) and plays the video, its plays fine just how I want it but when I press the back button to check my list of videos, if I havent stopped the video before it keeps playing.. Do you have any idea how can I stop that from happening?
Javascript:
function playVideo(id, title, description) {
var output ='<iframe src="http://www.youtube.com/embed/'+ id +'?wmode=transparent&HD=0&rel=0&showinfo=0&controls=1&autoplay=1" frameborder="0" allowfullscreen></iframe>';
output += '<h3>' + title + '</h3>';
output += '<p>' + unescape(description) + '</p>';
$('#myplayer').html(output);
}