Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search is not working when audio player is open
- This topic has 9 replies, 2 voices, and was last updated 2 years, 8 months ago by
Tomkaragounis.
-
AuthorPosts
-
September 8, 2023 at 9:35 am #45298
Tomkaragounis
ParticipantHello Team!
Congrats on the product of Ajax search! Honestly such a cool plugin for us πI have a problem with my website (https://dev2.streamee.gr) which streams background (continues) music on each page. The whole wordpress is a SPA (ajax content) and when I have a player open and listen to music and go to my search page https://dev2.streamee.gr/search, then the search is not being triggered and the results are not being shown.
Steps to reproduce:
1. Open https://dev2.streamee.gr/mood/greek-hits
2. Hit play
3. From sidebar or footer click on search menu (I have ilink between the link pages so my player not stop), so dont go direct please, use link
4. Try using searchI have been busting my mind for a few days in this problem…
*When I try the same thing, but have an input search of the sidebar, (and audio player is open), then the search work OK.
*7 years ago you suggested this on a comment on themeforest that had the same problem, I have tried it, but didnt work on my end:“Iβve installed the plugin on my test environment, but it was not working with Ajax Search Pro, as it created dynamical content (the results) and these were not recognized by AWS.
However after checking the AWS code Iβve managed to find a quick workaround without changing any of the plugins code. If I put this code into the active theme footer.php file just before the closing body tag: http://pastebin.com/raw.php?i=RzxBctgk
..then itβs working π This code basically recognizes when the search displays the results and binds the ajaxify() function to it.”Please let me know π
Have a great day!
Lots of dev lov <3,
TomSeptember 8, 2023 at 12:53 pm #45301Ernest Marcinko
KeymasterHi Tom,
Well, this is going to be a really tough one. Unfortunately I can’t promise anything, as this is a very special case of combining multiple stuff together.
Generally I would recommend avoiding live reloading of the whole site contents where possible, I guess in this case it’s not because of the music player.
I believe the issue is related to the results shortcode here. What I noticed is that for some reason it is completely cleared from the content area and the plugin is not able to push it back.
Can you try using on the simple plugin shortcode to see how that acts?
[wd_asp id=1]September 8, 2023 at 1:24 pm #45305Tomkaragounis
ParticipantHello Ernest!
Thanks for reaching out and answering so quickly.
Yes… you are right.. This conflict of ajax type sites are sooo hard… Can we try together though? I work as developer but honestly I have tried every other solution, like adding the code to header or sidebar (it actually work on sidebar, and loads the content on top of other menu items, while audio player is playing, so thats a good). When tried to add in on header and have it display only on /search page, I had so many conflicts, I had to change approach.I made the change but unfortunately, didn’t make any change. You can check the template of the search if you want on streamee-theme/streamee-custom-search.php
* I also re-enable the input search on sidebar, so you can see it working while audio player is on.
Please let me know on how could I help πCheers mate,
TomSeptember 8, 2023 at 1:29 pm #45306Ernest Marcinko
KeymasterSure, I will try to help you out as much as I can.
I still can see a results shortcode container in the left sidebar search, can you please change that shortcode as well?
Do you have programmatical access to the event where the ajax page loading finishes? If so, then placing this line of code to the event listener function may resolve the problem:
ASP.initialize()September 8, 2023 at 1:47 pm #45309Tomkaragounis
ParticipantI got blocked from this site due to code I guess. Gonna try again
September 8, 2023 at 1:49 pm #45310Tomkaragounis
ParticipantHello,
I change the sidebar’s shortcode to [wd_asp id=1]
I dont know exactly where the ajax page loading finishes in the JS files. (I didnt develop this evvironment).
I tried these 3 solutions to add this after ajax page loading finishes with the below codes, but none have worked:https://jsfiddle.net/3uwhL8om/
The main JS files that is responsible for most of the actions is on streamee-theme/js/streamee.js if you want to take a look.
Any ideas on how to implement correctly?
Thank you!
September 8, 2023 at 1:53 pm #45312Ernest Marcinko
KeymasterGreat, that helped.
This variation seems to work for me:
jQuery(document).ajaxComplete(function(event, xhr, settings) { ASP.initialize() });See here: https://i.imgur.com/aVeYrQ1.png
That should do the trick π
September 8, 2023 at 1:58 pm #45313Tomkaragounis
ParticipantThat DID the trick! WOW
1000 thanks mate! You saved me today. Thank you π
Lots of dev love,
TomSeptember 8, 2023 at 1:58 pm #45314Ernest Marcinko
KeymasterYou cannot access this content.
September 8, 2023 at 2:02 pm #45315Tomkaragounis
Participant100% I will do 5 stars.
Thanks again!
-
AuthorPosts
- The topic ‘Search is not working when audio player is open’ is closed to new replies.