Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • 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 281 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
    A
    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
      RichardR
      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

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      Online Users
      C
      chris.vuko
      OLVVDBO
      OLVVDB
      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