Advertisement:

Author Topic: Ohara YouTube Embed  (Read 200190 times)

Offline Rock Lee

  • Native Language Support Specialist
  • SMF Hero
  • *
  • Posts: 3,031
  • Gender: Male
  • I also speak english :D
    • BomberCode.Oficial on Facebook
    • RockLee-BC on GitHub
    • @Bomber_Code on Twitter
    • Bomber Code ~ La nueva era del conocimiento
Re: Ohara YouTube Embed
« Reply #580 on: July 19, 2016, 07:38:25 PM »
@coltp45, @Rock Lee  theres seems to be an issue with non-responsive themes, can you replace your /Themes/default/scripts/ohyoutube.min.js file with the one I'm attaching to see if the changes I made fixes this issues?

Be sure to clean your browsers cache or do a hard refresh (Control + F5)

@Suki Perfectirijillo've ;) tried it with multiple browsers and apparently this solved the problem plays smoothly now!


Regards!
¡Regresando como cual Fenix! ~ Bomber Code © 2018
Ayudas - Aportes - Tutoriales - Y mucho mas!!!


Ayudame via PayPal

Offline Coon

  • Jr. Member
  • **
  • Posts: 171
  • Gender: Male
  • Check out my forum if you like soccer!
    • Freestyle Soccer
Re: Ohara YouTube Embed
« Reply #581 on: August 04, 2016, 03:25:57 PM »
I've installed the mod and enabled it but my old posts are not converting from link to embedded video. I just did an upgrade from 1.1 to 2.0 and installed the 2.0 mod - I'm using the default theme.

Screenshots attached of what it looks like.

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,565
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: Ohara YouTube Embed
« Reply #582 on: August 04, 2016, 04:21:37 PM »
Make sure the install was successful, it seems the file edits didn't get applied, check the mod's parser and make sure the edits were done.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,565
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: Ohara YouTube Embed
« Reply #583 on: August 12, 2016, 12:56:34 PM »
New version available.

1.2.7 - Aug 12, 2016,
- Set basedWidth and basedHeight to prevent weird behavior on non responsive themes.

To upgrade uninstall any previous versions and install the new one, if using a custom theme make sure to check its corresponding checkbox under "Install in Other Themes" when installing.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline ninik

  • Semi-Newbie
  • *
  • Posts: 99
    • AncientGreeceReloaded/ on Facebook
    • @AncientGreece_R on Twitter
    • Ancient Greece Reloaded
Re: Ohara YouTube Embed
« Reply #584 on: August 25, 2016, 07:18:45 AM »

Hi Suki,

I installed the mod and although the vimeo video does play unfortunately the youtube window remains black and does not play at all???!!!

Could you please take a look and see what is wrong? the to a post link is: http:www.ancientgreecereloaded.com/files/ancient_greece_reloaded_website/forum/index.php/topic,232.0.html

From what I understood while looking at it, there was something wrong with your ohyoutube.min.js (in line 7); I guess...

I did also PM you...

I am looking forward to your reply, thanks in advance  :)


Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,565
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: Ohara YouTube Embed
« Reply #585 on: August 25, 2016, 11:07:20 AM »
Topics aren't visible for guests.

The blank window is a result of a JavaScript issue on your site, use your browser develop tools to see where the error is.  Most of the time is an old mod using old code or multiple mods trying to load Jquery multiple times.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline ninik

  • Semi-Newbie
  • *
  • Posts: 99
    • AncientGreeceReloaded/ on Facebook
    • @AncientGreece_R on Twitter
    • Ancient Greece Reloaded
Re: Ohara YouTube Embed
« Reply #586 on: August 25, 2016, 12:30:37 PM »


Hi Suki thanks for your reply.

OK the problem appears to be this line here in the ohtoutube.min.js :



Code: [Select]
var _oh=function(){this.masterDiv=$(".oharaEmbed");this.basedElement=this.masterDiv.parent();this.defaultWidth="undefined"!==typeof _ohWidth?_ohWidth:480;this.defaultHeight="undefined"!==typeof _ohHeight?_ohHeight:270;this.aspectRatio=this.defaultHeight/this.defaultWidth;this.basedWidth=this.basedElement.width()>=this.defaultWidth?this.defaultWidth:this.basedElement.width();this.basedHeight=this.basedElement.height()>=this.defaultHeight?this.defaultHeight:this.basedElement.height();this.main();this.responsive()};



It says: ohyoutube.min.js:7 Uncaught TypeError: $ is not a function


Sorry if I am novice in that department...

Could you help me out with this code?

Thank you

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,565
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: Ohara YouTube Embed
« Reply #587 on: August 25, 2016, 12:56:51 PM »
Its a side effect. Theres probably another mod that already loaded jquery and its not using $, instead it uses jQuery.

Open your /Sources/OharaYTEmbed.php

find this:

Code: [Select]
<script type="text/javascript" src="'. $settings['default_theme_url'] .'/scripts/ohyoutube.min.js"></script>
change it to this:

Code: [Select]
<script type="text/javascript" src="'. $settings['default_theme_url'] .'/scripts/ohyoutube.js"></script>

find your /Themes/default/scripts/ohyoutube.js  file

replace all instances of $ with jQuery.


Thats just a general approach, I don't know what other mods you are currently using.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline ninik

  • Semi-Newbie
  • *
  • Posts: 99
    • AncientGreeceReloaded/ on Facebook
    • @AncientGreece_R on Twitter
    • Ancient Greece Reloaded
Re: Ohara YouTube Embed
« Reply #588 on: August 25, 2016, 01:04:10 PM »


Hi Suki, I did the first think asked.

In regards to the second,

you say "replace all instances of $ with jQuery."

What do you mean exactly, to replace the "$" with the word "jQuery"?

Sorry for the stupid question...  :-\


Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,565
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: Ohara YouTube Embed
« Reply #589 on: August 25, 2016, 01:18:38 PM »
Open that file with a code editor (notepadd++ is free and works well)  search for $ and replace with with jQuery, notepad++ has a feature to replace all instances of a word.  Save it, upload the file to the same location, clean your forums and browser cache.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline ninik

  • Semi-Newbie
  • *
  • Posts: 99
    • AncientGreeceReloaded/ on Facebook
    • @AncientGreece_R on Twitter
    • Ancient Greece Reloaded
Re: Ohara YouTube Embed
« Reply #590 on: August 25, 2016, 03:37:41 PM »


Hi Suki, sorry for the delayed reply.

I did all the changes that you requested me to do, uploaded the files back to the server and had to wait for propagation to do its thing...

and... IT IS WORKING!!!  ;D

You are a genius Suki and I honestly thaaaaaaaaaaaaaank you!!!  :laugh:


Offline oldcopy

  • Newbie
  • *
  • Posts: 4
Re: Ohara YouTube Embed
« Reply #591 on: September 18, 2016, 05:11:53 AM »
SMF 2.1 beta 2 - not work.

Log:

The callable OharaYTEmbed::runTimeHooks could not be called.

Online d3vcho();

  • Sempiterno
  • Lead Localizer
  • SMF Hero
  • *
  • Posts: 3,965
  • Gender: Male
    • frandominguez03 on GitHub
Re: Ohara YouTube Embed
« Reply #592 on: September 18, 2016, 05:13:27 AM »
This Mod (and almost every mod) is not meant to work with 2.1 yet (one of the reasons because SMF 2.1 has not been released). You'll have to wait for a future release.

Regards :)

"Greeting Death as an old friend, they departed this life as equals."

Offline oldcopy

  • Newbie
  • *
  • Posts: 4
Re: Ohara YouTube Embed
« Reply #593 on: September 18, 2016, 06:19:31 AM »
I tried:

For those of you interested, I've been updating this mod to work and use some of the new features SMF 2.1 offers, so far this is the result. Attached is a beta of this mod for SMF 2.1, the new features include:

Installed mod without error, but does not work.

Online d3vcho();

  • Sempiterno
  • Lead Localizer
  • SMF Hero
  • *
  • Posts: 3,965
  • Gender: Male
    • frandominguez03 on GitHub
Re: Ohara YouTube Embed
« Reply #594 on: September 18, 2016, 06:22:07 AM »
Oops! My bad. You should wait for Suki's answer then.

Have a nice day :)

"Greeting Death as an old friend, they departed this life as equals."

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,565
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: Ohara YouTube Embed
« Reply #595 on: September 18, 2016, 01:20:03 PM »
@oldcopy  What package are you trying to install?

Make sure all files this mod needs are properly copied to their respective SMF folders.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline FishingManMatt

  • Semi-Newbie
  • *
  • Posts: 62
  • Gender: Male
Re: Ohara YouTube Embed
« Reply #596 on: October 22, 2016, 02:30:18 PM »
Hi Suki, hi guys!

While browsing files on my server I stumbled upon the following code in the Post.php file:

Code: [Select]
// Let's see if there's still some content left without the tags.
if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img><iframe><div><iframe><div>')) === '' && (!allowedTo('admin_forum') || strpos($_POST['message'], '[html]') === false))
$post_errors[] = 'no_message';

It turned out that the img tag was modified by the following mod's xml instructions:

Code: [Select]
<file name="$sourcedir/Post.php">
<operation>
<search position="replace"><![CDATA[<img>]]></search>
<add><![CDATA[<img><iframe><div>]]></add>
</operation>
<operation>
<search position="replace"><![CDATA[<img>]]></search>
<add><![CDATA[<img><iframe><div>]]></add>
</operation>
</file>

In my Post.php file it looks like the img tag was replaced twice.

And the other img tag in this file (there are only two) is untouched:

Code: [Select]
if ($smcFunc['htmltrim'](strip_tags(parse_bbc($_POST['message'], false), '<img>')) === '')
{
$post_errors[] = 'no_message';
unset($_POST['message']);

I'm wondering if this is an installation bug or... maybe something went wrong during an update?

Offline Suki

  • Kaizoku Jotei
  • Developer
  • SMF Super Hero
  • *
  • Posts: 15,565
  • Oh, wouldn't it be great if I *was* crazy?
    • MissAllSunday on GitHub
    • SMF mods
Re: Ohara YouTube Embed
« Reply #597 on: October 23, 2016, 09:47:44 AM »
Its a bug on the mod, I believe I fixed it by having a wider search for code and make sure both places got covered. I dunno if I released that, I will have to check.  In the mean time, you can manually apply the change to both places or leave it as it is. This only affects you is you post a video and nothing more.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline FishingManMatt

  • Semi-Newbie
  • *
  • Posts: 62
  • Gender: Male
Re: Ohara YouTube Embed
« Reply #598 on: October 23, 2016, 10:19:02 AM »
Many thanks Suki!
I've just can manually applied the change to both img tags.

Offline lahmfan

  • Semi-Newbie
  • *
  • Posts: 37
Re: Ohara YouTube Embed
« Reply #599 on: October 23, 2016, 11:47:36 AM »
this mod doesnt seems to convert links that start with https://m.youtube.com. how can i add that?