Hey @djvinz98! 👋
Yes, you can control the chatbot from other events on your front web page. For this, you will need to use the front-end JavaScript API of the AI Engine and use the open() function when clicking on your image. Learn more here: API & Filters | Meow Apps
Thanks for the reply, I managed to create the code, but I have a problem when I insert it into the page builder that I use, that is, Elementor, the code works and when I click on the video the chat opens, but when I save the page and enter the site normally the javascript isn’t read and nothing happens when I click, it’s strange because it works in Elementor.
<video id="video" playsinline autoplay loop muted>
<source src="https://romanoauto.it/wp-content/uploads/2024/06/Bryan-Romano-Auto-Mobile.mp4" type="video/mp4">
</video>
<script>
var video = document.getElementById("video");
video.addEventListener("click", chatbot.open)
</script>
the problem comes from the “chatbot.open()” code because if inserted a different function it works.
I also tried to write the code differently from the one I provided in the previous message, but it gives me the same problem, it works on Elementor, but then when I save the page and enter the site nothing appears, I also tried removing the video and to put a photo, or a button, but always the same. Are we missing some code that I should enter to get it started?
-
This reply was modified 1 year, 11 months ago by
djvinz98.
-
This reply was modified 1 year, 11 months ago by
djvinz98.
Hey @djvinz98! 👋
You cannot call the function without first defining the chatbot variable correctly. Please ensure you are using the following method to declare your chatbot variable. Also, ensure this declaration occurs only after the DOM has finished initializing. Thank you!
let chatbot = MwaiAPI.getChatbot();
Hi, thanks for the help. I did some tests, but I can’t understand how to insert this part of code to make it work, can you help me by any chance? Thank you
Hey @djvinz98! 👋
We are unable to offer support for custom code or specific use cases. If you believe there is an issue related to the plugin API, please let us know so we can assist you accordingly. For developing custom solutions, you may consider reaching out to freelancers who can help you with coding your solution. Thank you for your understanding.