-
AuthorPosts
-
September 15, 2015 at 6:34 pm #503593
Hi all, first up, thanks for the great theme. Second, thanks to whoever it was sorted my login details out.
Third up, and the most important issue for me right now is how to get the mashshare plugin working with Enfold.Please see message below from the Mashshare author René. Thanks for any help you may be able to give. Sped.
Dear Enfold Dev,
I am using the Mashshare VideoPost plugin which is embeding the the regular youtube API to embed a youtube video in post but this is not working with Enfold. It seems as avia.js is breaking the youtube API here.
I am asking on behalf of the Mashshare devoper how to adjust the code to be compatible with Enfold.
This js is is injected by Mashshare with use of a shortcode.
<script type='text/javascript'> popuploaded = false; </script> <div class="mashvipo-container"> <div id='mashvipoplayer'></div> </div> <script type='text/javascript'> // This code loads the IFrame Player API code asynchronously. var tag = document.createElement('script'); tag.src = "//www.youtube.com/player_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); // This function creates an <iframe> (and YouTube player) after the API code downloads. var player; function onYouTubePlayerAPIReady() { player = new YT.Player('mashvipoplayer', { wmode: 'transparent', videoId: 'YP9PizYicxY', playerVars: { enablejsapi:1, controls:1, showinfo:0, color:'white', rel:0, wmode:'transparent', modestbranding:1, theme:'dark', // not working here //autoplay:, iv_load_policy: 1 }, events: { onStateChange: onPlayerStateChange, onReady: loadMashVipo } }); } function loadMashVipo(event) { event.target.cueVideoById({ videoId:'YP9PizYicxY', }); } // when video runs var done = false; function onPlayerStateChange(event) { if (event.data == YT.PlayerState.ENDED || done === true) { //insert appropriate modal (or whatever) below likemodal(); } }; /* Stop the video */ function stopVideo() { player.stopVideo(); done = true; } </script>
Thank you very much for your assistance.
Kind regards
René Hermenau- This topic was modified 9 years, 2 months ago by dasped.
September 16, 2015 at 4:42 am #503798Hey!
Can you post a link to your site? specifically to the page where you’re trying this code.
Cheers!
JosueSeptember 16, 2015 at 5:01 pm #504292Hi, I have a test environment for you to check, details below.
Thanks.
September 16, 2015 at 11:20 pm #504429Hi,
Can you please check if the issue persists with the default WordPress theme activated?
Regards,
JosueSeptember 16, 2015 at 11:53 pm #504442Video loads fine. There has been a month of testing here and all has been working without issue until I selected to work with Enfold. Thanks
Please feel free to try it yourself. This is a test environment so I have no issue with you activating and testing the theme for yourself.- This reply was modified 9 years, 2 months ago by dasped.
September 17, 2015 at 5:15 pm #505008Hi!
What happens when you change line 706 in the /enfold/js/shortcodes.js file from this.
youtube : {loaded: false, src: 'https://www.youtube.com/iframe_api' }
To this.
youtube : {loaded: true, src: 'https://www.youtube.com/iframe_api' }
Cheers!
ElliottSeptember 17, 2015 at 5:28 pm #505022Hi Elliott,
I have just changed the line as requested and there is unfortunately no change, the video still does not show up.I have left the line as changed for your inspection. Please feel free to trial any methods yourselves rather than asking. I give you my express permission to tweak anything you like in order that it will speed the process up and make life easier all round.
Thanks.
- This reply was modified 9 years, 2 months ago by dasped.
September 20, 2015 at 12:49 am #505992Any further ideas Gents? Sorry for the bump, but I’m really hoping this can be figured out. Thanks.
September 21, 2015 at 1:04 pm #506380Hi!
unfortunately we have no idea how mashshare plugin works, that is why I suggest to ask plugin’s author for support about it.
Let us know if you have any questions directly related to the theme and we are happy to assist you.Best regards,
AndySeptember 21, 2015 at 2:18 pm #506425Did you miss my opening post Andy?
The message I posted ‘is’ off the developer where he has identified that avia.js is breaking the youtube API when the Masshare JS is injected.
I have tested with numerous premium themes without issue since running into difficulty with Enfold.
I had really hoped to use Enfold but if you guys can’t help, it will have to go.
Thanks.
- This reply was modified 9 years, 2 months ago by dasped.
September 21, 2015 at 5:07 pm #506534Hey!
Try commenting out lines 103 – 107 to see if it’s a problem with our JS.
//activate the video api if($.fn.aviaVideoApi) { $('.avia-slideshow iframe[src*="youtube.com"], .av_youtube_frame, .avia-slideshow iframe[src*="vimeo.com"], .avia-slideshow video').aviaVideoApi({}, 'li'); }
This will make it so none of our video features will work though.
Regards,
ElliottOctober 17, 2015 at 9:58 pm #520481Hi all, coming back to this as the developer has found a solution.
It would be fantastic if you guys could contemplate adding an option for users to disable youtube videos from lightbox. The reason I ask is that it currently breaks any third party plugin using the youtube api.
For the moment we have had to change the following in /wp-content/themes/enfold/js/avia.js on line 897
//videoElements : 'a[href$=".mov"] , a[href$=".swf"] , a:regex(href, .vimeo\.com/[0-9]) , a[href*="youtube.com/watch"] , a[href*="screenr.com"], a[href*="iframe=true"]',
to
videoElements : 'a[href$=".mov"] , a[href$=".swf"] , a:regex(href, .vimeo\.com/[0-9]) , a[href*="screenr.com"], a[href*="iframe=true"]',
Also on line 603 of avia.js
if(url) { if( url.match(/(jpg|gif|jpeg|png|tif)/) ) span_class = "overlay-type-image"; if(!url.match(/(jpg|gif|jpeg|png|\.tif|\.mov|\.swf|vimeo\.com|youtube\.com)/) ) span_class = "overlay-type-extern"; }
to
if(url) { if( url.match(/(jpg|gif|jpeg|png|tif)/) ) span_class = "overlay-type-image"; //if(!url.match(/(jpg|gif|jpeg|png|\.tif|\.mov|\.swf|vimeo\.com|youtube\.com)/) ) span_class = "overlay-type-extern"; }
Would be fantastic to see something along these lines implemented into one of the next releases. I’m sure others will come up against YouTube issues at some point, if they haven’t already.
Regards,
SpedOctober 18, 2015 at 2:57 am #520495Sure i’ll suggest it to Kriesi.
January 23, 2016 at 11:06 pm #570628Well, I tried and can say: It does not work.
The second part is a little difficult explained:
* Its in line 630
* then just skip the second line with two slashes //–> however: Unfortunately it does not work!
January 23, 2016 at 11:26 pm #570632No it won’t. There have been numerous updates to the theme since my initial posting.
To be honest I literally just dropped the theme because of this issue. Well, primarily because of that. I couldn’t keep going back to my plugin author every time an updated version of the theme was released. (Though he has been really supportive).
I’d have much rather had the theme author / devs have come up with a solution but kind of felt like the support levels here were rather minimalistic when it comes to a code cruncher like this. (No disrespect) But they are beholden to Kriesi’s work and so if he doesn’t engage its pretty much game over. Or it certainly was for me.
Enfold is a fantastic theme, if you don’t need too many extra features. I just struggled with a good 60%+ of plugins I tried with it. JS reliant ones especially. I guess that’s a risk you take nowadays when buying themes as extensively developed as this. All under one roof is fine, if that’s all you need.
January 27, 2016 at 5:42 am #572580 -
AuthorPosts
- The topic ‘Mashshare Plugin with Enfold’ is closed to new replies.