Youtube embed player on Guru3d is dated + Bringing Guru3d up to 2016 standards?

Discussion in 'The Guru's Pub' started by XenthorX, Mar 22, 2016.

  1. XenthorX

    XenthorX Ancient Guru

    Messages:
    3,472
    Likes Received:
    1,397
    GPU:
    3090 Gaming X Trio
    I've been uploading 1440p over the last 6months on Youtube, and when sharing them here, i realized that i could only watch them at 1080p on Guru3d.

    Would it be possible to update the embed player? :D


    edit: i'm on last version of Chrome*, and actually i would love some refreshing design of guru3D ^^. I whitelisted Guru3D and ads integration is... shaky. Guess Guru3d could use some update up to 2016 internet standard :D
     
    Last edited: Mar 22, 2016
  2. scatman839

    scatman839 Ancient Guru

    Messages:
    14,115
    Likes Received:
    510
    GPU:
    1080, KD55XD800
    What i'd really like is if the youtube bb code allowed for full youtube URLs (not just video IDs), and if there was a button on the quick reply that had a pop up asking for the youtube url (like with the image and url one)

    But it runs on flash, not sure how well flash copes with 1440p (never mind 1080p60), maybe time for a html 5 youtube bb?
     
  3. dcx_badass

    dcx_badass Ancient Guru

    Messages:
    9,979
    Likes Received:
    1
    GPU:
    Palit GTX 1060 6GB
    I have embedded videos disabled, it would be nice if it showed the url and maybe the title as well rather than just empty space, although that's a general web issue, not specific to this site.
     
  4. Anarion

    Anarion Ancient Guru

    Messages:
    13,669
    Likes Received:
    399
    GPU:
    GeForce GTX 1070
    I don't have flash so I'll just use my JavaScript bookmarklet to replace the flash players with the html5 YouTube player.
     

  5. XenthorX

    XenthorX Ancient Guru

    Messages:
    3,472
    Likes Received:
    1,397
    GPU:
    3090 Gaming X Trio
    Sweet ! Thanks
     
  6. Anarion

    Anarion Ancient Guru

    Messages:
    13,669
    Likes Received:
    399
    GPU:
    GeForce GTX 1070
    Hmmm... Is that sarcasm?


    If it would be possible to add custom tags i.e. [youtubee]youtubeurl[/youtubee] and then replace that in posts with this:
    Code:
    <script type="text/javascript">
    yt("youtubeurl");
    </script>
    
    and then add js like this in header:
    Code:
    <script type="text/javascript">
    function yt(url) {
    
    var regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;
    var match = url.match(regExp);
    
    
    var iframe = document.createElement('iframe');
        iframe.src = "//www.youtube.com/embed/"+match[2];
        
        iframe.setAttribute("allowfullscreen", "");
        iframe.width = "800";
        iframe.height = "450";
        iframe.style.margin = "0 auto";
        iframe.style.display = "block";
        iframe.style.border = "none";
    
        var location = document.scripts[document.scripts.length - 1];
        var parent = location.parentElement;
        parent.insertBefore(iframe, location.nextSibling);
    }
    
    </script>
    
    everything should would work beautifully.

    Personally I use this to replace all legacy flash youtube videos with HTML5 versions:
    Code:
    javascript:[].forEach.call(document.querySelectorAll("object"),function(a){var%20b=document.createElement("iframe");var%20c=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;try{var%20d=a.getElementsByTagName("embed")[0].getAttribute("src")}catch(e){try{var%20d=a.getAttribute("data")}catch(ex){var%20d="empty"}}if(!(d.indexOf("youtube")>-1)){return}var%20f=d.match(c);var%20g=a.offsetWidth;var%20h=Math.ceil(a.offsetWidth/(16/9));b.style.border="none";b.style.margin="1em%20auto";a.parentElement.insertBefore(b,a.nextSibling);a.parentElement.removeChild(a);b.setAttribute("allowfullscreen","");b.width=g;b.height=h;b.style.display="block";b.src="https://www.youtube.com/embed/"+f[2];});
    
    It's a bookmarklet so you copy and paste that **** in the bookmark location field. If that that bookmarklet javascript would be included in forum template footer it would do the magic automatically. It would just work.

    This is bookmarlet JS neatly formatted:
    Code:
    [].forEach.call(document.querySelectorAll('object'), function (a) {
      var b = document.createElement('iframe');
      var c = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/;
      try {
        var d = a.getElementsByTagName('embed')[0].getAttribute('src')
      } catch (e) {
        try {
          var d = a.getAttribute('data')
        } catch (ex) {
          var d = 'empty'
        }
      }
      if (!(d.indexOf('youtube') > - 1)) {
        return
      }
      var f = d.match(c);
      var g = a.offsetWidth;
      var h = Math.ceil(a.offsetWidth / (16 / 9));
      b.style.border = 'none';
      b.style.margin = '1em auto';
      a.parentElement.insertBefore(b, a.nextSibling);
      a.parentElement.removeChild(a);
      b.setAttribute('allowfullscreen', '');
      b.width = g;
      b.height = h;
      b.style.display = 'block';
      b.src = 'https://www.youtube.com/embed/' + f[2];
    });
    
     
    Last edited: Mar 28, 2016
  7. scipio

    scipio Ancient Guru

    Messages:
    4,636
    Likes Received:
    8
    GPU:
    Evga 1080 gaming
    Since I browse mostly from my phone, I can't see any of them
     
  8. Anarion

    Anarion Ancient Guru

    Messages:
    13,669
    Likes Received:
    399
    GPU:
    GeForce GTX 1070
    I use the bookmarklet on my phone too.

    [​IMG]
     
    Last edited: Mar 25, 2016
  9. scipio

    scipio Ancient Guru

    Messages:
    4,636
    Likes Received:
    8
    GPU:
    Evga 1080 gaming
    Where's the bookmark location field?
     
  10. Anarion

    Anarion Ancient Guru

    Messages:
    13,669
    Likes Received:
    399
    GPU:
    GeForce GTX 1070
    Last edited: Mar 25, 2016

  11. dsbig

    dsbig Ancient Guru

    Messages:
    4,041
    Likes Received:
    37
    GPU:
    EVGA RTX 2070
    I keep saying.................:pc1::bang:
     
  12. scipio

    scipio Ancient Guru

    Messages:
    4,636
    Likes Received:
    8
    GPU:
    Evga 1080 gaming
    Crap I can watch them in chrome no problem no script, it's opera mobile that's no dice...
     
  13. Anarion

    Anarion Ancient Guru

    Messages:
    13,669
    Likes Received:
    399
    GPU:
    GeForce GTX 1070
    Well... It's totally up to you if you want to get them to work or not. As I posted above, the solution is simple.

    [​IMG]
     
  14. scipio

    scipio Ancient Guru

    Messages:
    4,636
    Likes Received:
    8
    GPU:
    Evga 1080 gaming
    I got it working thanks Anarion
     
  15. floppyedonkey

    floppyedonkey Member

    Messages:
    27
    Likes Received:
    1
    GPU:
    MSI GTX 980Ti GAMING 6G
    Good idea on updating the forums and tools.
     

  16. LocoDiceGR

    LocoDiceGR Ancient Guru

    Messages:
    2,262
    Likes Received:
    772
    GPU:
    Gigabyte R9 380 4G
    Agreed! +1
     

Share This Page