Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Different Video Play ICONs

Different Video Play ICONs

Scheduled Pinned Locked Moved General Discussion
2 Posts 2 Posters 76 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Aleksandar
    wrote on last edited by
    #1

    Hi there!

    Is it possible to use different Video Play ICONs for different pages/projects?

    Video Play ICON in red!
    (Regular play button set in Lay Options)

    However for an other page I'd like to use a black one.
    How could I do this?

    All best
    Aleks

    1 Reply Last reply
    0
    • RichardR Offline
      RichardR Offline
      Richard
      Global Moderator
      wrote on last edited by Richard
      #2

      Dear Aleks @Aleksandar

      Sorry for the delay :)
      This is possible, my first thoughts were to work with (jQuery).

      You will first need to look into using Javascript and jQuery with Lay Theme:
      https://laytheme.com/documentation.html#custom-javascript

      Specifically the 'Newpage Event' , Changing the Common jQuery character ' $ " into 'jQuery' & how to run the Script on a specific page or project e.g

      <script>
      window.laytheme.on("newpageshown", function(layoutObj, type, obj){
      	if(type == "project" && obj.id == 1){
      		console.log("fantastic!");
      	}
      });
      </script>
      

      Will console Log "fantastic" ' If ' the user is on the project with ID : 1

      Each page or project has a data-type & unique data-id , that can be found in the <head> of your webpage - You can view the HTML structure of a webpage using the Developer Tools within a browser:
      https://www.khanacademy.org/computing/computer-programming/html-css/web-development-tools/a/using-the-browser-developer-tools

      I will be using this Stackoverflow thread as reference:
      https://stackoverflow.com/questions/554273/changing-the-image-source-using-jquery

      Within you videos HTML structure you will see an <img> element like this, with a src path linking to your saved custom icon file:

      <img class="html5video-customplayicon" src="http://www.aleksandartodorovic.com/media/play-button-large.png">
      

      We can use jQuery to redefine the src path to a different image if you wish. When viewing your Media Library clicking on an image will show you some more information about that image - At the bottom is the 'FILE URL' info - we can copy that and use it.

      Screen Shot 2021-03-23 at 7.55.24 PM.png

      This Code:

      jQuery(".html5video-customplayicon").attr("src","https://yourdomain.com/wp-content/uploads/2021/03/PngItem_2100439-1.png");
      

      jQuery > Find me element with 'class' html5video-customplayicon

      Find the 'src' attribute 'attr'

      Define new 'src' attribute

      You will need to put the url path of your choice in.
      And using the earlier 'If' project and id etc

      Hope this helps Aleks & have a wonderful day, Thank you for using Lay Theme! :)

      Sincerely
      Richard

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      I also code custom websites or custom Lay features.
      šŸ’æ Email me here: šŸ’æ
      info@laytheme.com

      Before you post:
      1. When using a WordPress Cache plugin, disable it or clear your cache.
      2. Update Lay Theme and all Lay Theme Addons
      3. Disable all Plugins
      4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

      This often solves issues you might run into

      When you post:
      1. Post a link to where the problem is
      2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
      3. If the problem is difficult to explain, post screenshots / link to a video to explain it
      Online Users
      Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
      laytheme.com
      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Recent
      • Tags
      • Popular
      • Users
      • Search