News:

Wondering if this will always be free?  See why free is better.

Main Menu

Ohara YouTube Embed

Started by Suki, December 21, 2011, 03:04:59 PM

Previous topic - Next topic

SaltedWeb

Quote from: Suki on August 10, 2014, 02:09:35 PM
You can begin with what I already said:

Quote from: Suki on August 10, 2014, 01:35:14 PM


$buttons[count($buttons) - 1][] = array(
'image' => 'youtube',
'code' => 'youtube',
'before' => '[youtube]',
'after' => '[/youtube]',
'description' => $txt['OYTE_desc'],
);


Make sure you have exactly that on your Sources/OharaYTEmbed.php file.


And also answering my questions:

Quote
Do you have any other mod that modifies BBC? had you made any change to Sources/OharaYTEmbed.php ?


If you're using the WYSIWYG mode chances are thats the issue, it has all sorts of problems with it, sometimes the tag doens't show, sometimes it show backwards: [youtube][/youtube]  etc. Unfortunately, I won't be fixing those issue as its just a big waste of time.


No no changes in the Sources/OharaYTEmbed.php ?

******************

Was unsure about the code changes applied since since was unsure the issues I was asking was the one you were answering.  Its ok, no biggy its consistent with [Youtube] I will just instruct my members to use it accordingly.
As I can not disable WYSIWYG as it require for many of our users.

I can also understand you not wanting to make it work with WYSIWYG, Its your mod and you can create it to work or not work with what ever you choose. However at http://custom.simplemachines.org/mods/index.php?mod=3268
There is no mention ( I saw) that this mod is is not WYSIWYG compatible. And being WYSIWYG is part of the posting system you might avoid people asking the same question I did by saying on the mod area not compatible with WYSIWYG.
It would not be by reasonable for users to assume they should not use particular parts of SMF on a mod, so noting that would be helpful I am sure.

Thanks for the help and code I will check it out.










Knowing your limitations makes you human, exceeding these limitations makes you worthy of being human.

Suki

Its not about me not wanting to fix those issues, it really comes down to the WYSIWYG mode been so buggy, no matter what I would do to fix an issue, more will arise and so on and on and on, hence the "big waste of time" phrase.

The mod as it stands doesn't work as people expect it to work on WYSIWYG mode, thing is, even disabling this particular BBC when using that mode is quite a hassle itself. So a hassle for avoiding another hassle makes no sense to implement.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Arantor

Actually, the WYSIWYG editor was specifically designed not to handle complex tags. It won't even touch quotes - and that's not a bug, that's literally by design.

br360

I'm seeing a few of these undefined errors a day.
8: Undefined index: OYTE_unvalid_linkApply
/var/www/vhosts/mysite.com/Sources/OharaYTEmbed.php(60) : runtime-created function
Line: 5


There doesn't seem to be a rhyme or a reason to the error, as it happens when people are doing things like checking the member list, doing a search of the forum, registering for an account, checking their pm's, etc. (and not when trying to post a youtube video)

When I go to press on the link in the error logs, I get this message that now becomes a new general error- "An Error Has Occurred! Sorry but the file specified could not be opened:"

Line 5 in that file is * @version 1.1

I checked my package manager, and I am definitely using version 1.1. I have also checked and unchecked "Disable evaluation of templates", and the error looks exactly the same either way.

I am currently using 2.0.7, but the issue was happening before I patched.

Suki

The error isn't actually on line 5 but on line 60, the five indicates the inner line inside the create_function()

A person doesn't have to be postign a video, this code wil be executed everytime someone calls parse_bbc() which is a function that is called on a lot of places, hence why the error appears on pages that doens't have anything to do with posting.


As for the error, you need to make sure your language files are uploaded correctly on the proper folder /themes/default/languages/

Theres also a new version, version 1.2: https://github.com/MissAllSunday/OharaYouTubeEmbed/releases  which is the current stable one.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

br360

Thanks Suki, good information to know.

The OharaYTEmbed.english.php looks fine to me, and everything does seem to be uploaded. Anything in particular I should be looking for?

I glanced over 1.2 briefly. Does it auto-embed videos, or can I disable that so people would still have to use the youtube tags in order for a video to show?

Suki

#206
It could be related to the actual text string which expects to be used along with sprintf(),  probably should be using something like this:

sprintf(txt['OYTE_unvalid_link'], 'youtube');

you could try and change the code in line 55:

$data = $txt[\'OYTE_unvalid_link\'];

with this:

$data = sprintf($txt[\'OYTE_unvalid_link\'], 'youtube');



Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Aaron10

#207
Hi, I'm using this mod as you recommended yesterday and it works great, but the perimeters don't seem to work, for example a playlist shows like this:
http://www.final7fantasy.com/testforum/index.php/topic,1.0/message,92.html

[the current video I linked from]
?list=PL345B49A52C73B94E

And also if you use the share code with a time perimeter:
http://youtu.be/Fj4alwt0FgA?t=42s

It'll remove the t= when switch it to a regular youtube URL.

Also how do I edit these in vimeo embed:

webkitallowfullscreen mozallowfullscreen

and change:

frameborder="0" to style="border: none;" (this I already did on the youtube ones).

These are minor issues though and I'm happy to use the mod, many thanks.

Suki

Can you post an url that includes a ?list param. a list of urls that causes the same issue would be handy too.

I'm afraid getting the start time will be tricky, it is already pretty difficult to get the video ID from all the different kinds of valid urls, I'm currently using 2 regex and PHPs native parse_url() to get the videos IDs and even with those 3 layers for catching the ID, there are still valid urls that will not be catched, adding one more param to get the ?t= value will make things even more difficult to handle :(

About vimeo, I'm currently using their oEmbed api which doesn't have a param to disallow or allow "webkitallowfullscreen" or " mozallowfullscreen"  it also doesn't allow you to modify the frameborder="0" param.


If you really want to change those values, the code will have to be re-written to use vimeo's Universal Player which is a much more customizable option.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Aaron10

It's actually doing it for both & and ? params. The ? only comes from the youtu.be share link

http://youtu.be/Fj4alwt0FgA?list=PL345B49A52C73B94E

Full link uses &
https://www.youtube.com/watch?v=Fj4alwt0FgA&list=PL345B49A52C73B94E

But also displays like the other:
http://www.final7fantasy.com/testforum/index.php/topic,1.0/message,92.html
http://www.final7fantasy.com/testforum/index.php/topic,1.0/message,94.html

Another with the playlist param:
http://www.final7fantasy.com/testforum/index.php/topic,1.0/message,95.html

Same thing for both, list=PL345B49A52C73B94E appears as text underneath the videos.

So for vimeo, where would I put this example URL in oharaYTEmbed.php:

<iframe src="//player.vimeo.com/video/71646438" width="500" height="281" style="border: none;"></iframe>

Bluedreams

Thank you for being one of the few working embed mods left!

Suki

Quote from: Aaron10 on August 20, 2014, 01:44:03 PM
It's actually doing it for both & and ? params. The ? only comes from the youtu.be share link

http://youtu.be/Fj4alwt0FgA?list=PL345B49A52C73B94E

Full link uses &
https://www.youtube.com/watch?v=Fj4alwt0FgA&list=PL345B49A52C73B94E

But also displays like the other:
http://www.final7fantasy.com/testforum/index.php/topic,1.0/message,92.html
http://www.final7fantasy.com/testforum/index.php/topic,1.0/message,94.html

Another with the playlist param:
http://www.final7fantasy.com/testforum/index.php/topic,1.0/message,95.html

Same thing for both, list=PL345B49A52C73B94E appears as text underneath the videos.

So for vimeo, where would I put this example URL in oharaYTEmbed.php:

<iframe src="//player.vimeo.com/video/71646438" width="500" height="281" style="border: none;"></iframe>

OK, thanks for the urls, I'm going to release a new version with  a fix for them.  I'll include a setting to disable/enable the auto embed too and will change the vimeo oembed api for the universal embed so it will be easier for people to customize the iframe.

Quote from: Bluedreams on August 21, 2014, 09:43:04 AM
Thank you for being one of the few working embed mods left!

Thanks!
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Aaron10

Ok I look forward to it and thanks for your hard work. Also forgot to ask, is it possible to allow the embeds to also work within quote tags?
http://www.final7fantasy.com/testforum/index.php/topic,1.0/message,99.html

Suki

It should work just fine if you quote a message that contains an embedded video.  How exactly are you posting it?  If you're quoting a message that already converted an url to a link then nop, the embed code will not work since that url is already a link.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Aaron10

Posted via plain link which was auto embedded then quoted.

mercelo


Suki

Its working just fine on my site: http://missallsunday.com/index.php?topic=21.msg3647#msg3647  and my 2.0 testing site as well.

Make sure your Sources/Subs.php has the relevant file edit. That edit is the responsible for auto embedding an url
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Aaron10

Ok I realized the problem, basically I'd quoted those posts BEFORE installing the mod, I just quoted them again and they work, so it doesn't update previously quoted videos. But if you insert a plain quote, like:

[quote]https://www.youtube.com/watch?v=g7cjDaOQpB0[/quote]

It'll display as a plain link
http://www.final7fantasy.com/testforum/index.php/topic,1.0/message,105.html

Suki

Yes, it doesn't update previous links, it will be a lot of work for your server to handle that.

As for quoting, it fails because the regex I'm using for auto embedding uses  the first regex and the first regex won't catch that, the second does catch it though.

I will add the second regex to the auto embed function to make sure more urls are been catched.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Suki

I just remember, I explicitly made the regex to not catch any url inside and BBC tag or anchor tags <a>, that was to prevent undesired behaviors such as auto embedding urls inside code tags, it affects quote tags too. So nope, posting a link inside any quotes or any other bbc tag won't be auto embedded.

But since I'm looking at it right now, I deleted the need to use http// or https on an url to be auto embedded.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Advertisement: