2

So I created an Ionic app on which you can search video's , watch them, share them and download them. I've used a facebook share button from someone else (the official one was sometimes displaying , and sometimes not) and a download button from a diffent site. Both work when testing in my browser but when I test it in the Ionic View app or put the app on my phone it doesnt share (it goes to facebook and share, but the link only displays http:// and the rest is empty) and the download button doesn't do anything.)

    popContent.innerHTML += "<button id='facebook'>Share on Facebook</button";

    getPopContent.innerHTML += '<iframe id="video2" width="560" height="10" 
          src="http://embed.yt-mp3.com/watch?v='+ this.id +'" frameborder="0"></iframe>';
    var facebookYTID = this.id;
    document.getElementById('facebook').onclick = function(){
      fbShare('https://www.youtube.com/watch?v='+facebookYTID+'/', 'Fb Share',
              'Facebook share popup', 'http://goo.gl/dS52U', 520, 350);
    }    
    var fbShare = function(url, title, descr, image, winWidth, winHeight) {
       var winTop = (screen.height / 2) - (winHeight / 2);
       var winLeft = (screen.width / 2) - (winWidth / 2);
       window.open('http://www.facebook.com/sharer.php?s=100&p[title]=' + title + 
                   '&p[summary]=' + descr + '&p[url]=' + url + '&p[images][0]=' + image
                   , 'sharer',  'top=' + winTop + ',left=' + winLeft + ',toolbar=0,
                     status=0,width=' + winWidth + ',height=' + winHeight);
   }    

EDIT:

So I found out that when I open in browser the download button works:

        getPopContent.innerHTML += '<iframe id="video2" width="560" height="10" src="http://embed.yt-mp3.com/watch?v='+ this.id +'" frameborder="0"></iframe>';

But I dont want to open it in browser, I want to load it in a Iframe so it doesn't go to another page (so you can just press download, downloads - stay on the page) which DOESN'T work. anyone got a solution?

Debialo
  • 43
  • 11

0 Answers0