• Resolved Kaleyko

    (@kaleyko)


    It would be way better if you make the plugin works with the default WordPress embedding… Just put the YouTube link and the plugin work with it, so if you deleted the plugin all the posts that you made months ago will still work.

    I mean what will happen if I deleted the plugin after months of using it? Will the videos show up or will be just httpv://youtube.com/example?

    https://wordpress.org/plugins/wp-youtube-lyte/

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author Frank Goossens

    (@futtta)

    You can easily enable that with a couple of lines of code as documented in lyte_helper.php_example Kaleyko.

    Thread Starter Kaleyko

    (@kaleyko)

    Then, why didn’t you do it from the start? Using the current technique could brake ALL of the previous video posts if someone decided to uninstall the plugin.

    Honestly, I won’t post only audio YouTube video. I’m going to only put regular YouTube video.

    I opened the file, but I’m really not that good with a code if it’s not CSS or HTML.

    Could you please do it for me and paste the code here and I will replace with the file by myself? I will really thankful.

    Finally, the available positioning of the video on the settings page are left and center only. I write in a language where the words start from right to left which means the video should be in the right. Would be really great if you add this with the next update.

    And a side question: I noticed that your plugin worked with iOS! Is this after the 7.1 update for iOS or what? Because I remember very good that this technique wasn’t working with iOS and if you clicked the layer over the YouTube video it won’t play and you won’t see the original click to play button on the video.

    Plugin Author Frank Goossens

    (@futtta)

    Because I don’t want Lyte to handle normal youtube links by default and because it’s easy to enable using the API.

    What you want to do is:

    1. copy /wp-content/plugins/wp-youtube-lyte/lyte_helper.php_example to /wp-content/plugins/lyte_helper.php
    2. open the file and on line 23 remove the double slash at the beginning to have:
      add_filter('lyte_content_preparse','lyte_force_nonhttpv',10,1);
    3. enable the lyte helper plugin in your wordpress admin

    Concerning positioning of the player; you should be able to do that by applying some CSS to the lyte; float:left on lyte-wrapper and clear:both on lL should do the trick.

    Regarding playback on iOS; there were problems with that which were fixed in the latest release, should work fine on older versions of iOS as well.

    hope this helps,
    frank

    Thread Starter Kaleyko

    (@kaleyko)

    Awesome!

    I add it and enabled the new plugin. Do I need the two of them now or I can deleted the original one?

    And what is the different if I just removed the double slash and hit save without duplicating the lyte_helper.php_example to /plugins and renaming it lyte_helper.php?

    Plugin Author Frank Goossens

    (@futtta)

    No, you need the two of them; “lyte helper” relies on “wp youtube lyte”.

    If you would make the changes to the original lyte_helper.php_example it would not appear in the list of plugins to be activated.

    have a nice weekend,
    frank

    Thread Starter Kaleyko

    (@kaleyko)

    Thanks.

    I just noticed an issue: The hyperlinks with YouTube videos shows the whole embedded video blew the hyperlink!

    In some posts that’s destroyed the whole layout of the website.

    Plugin Author Frank Goossens

    (@futtta)

    Not sure I understand, can you provide a link (to a blogpost with the problem or to a -partial- screenshot)?

    Thread Starter Kaleyko

    (@kaleyko)

    Hyperlink: This is a link.

    Plain Link: http://youtube.com/example.

    Both shows embeded YouTube videos.

    The hyperlink should not show an emended video at all. It’s a hyperlink that the visitor click and he will go to YouTube and watch the video from there.

    Plugin Author Frank Goossens

    (@futtta)

    ah, that’s one of the reasons I don’t like WP YouTube Lyte to automatically parse normal youtube URL’s 😉

    Anyway, that’s something that can be changed in the example code in lyte_helper.php.

    On line 25 you could try changing

    $content=preg_replace('/https?:\/\/(www.)?youtu(be.com|.be)\/(watch\?v=)?/','httpv://www.youtube.com/watch?v=',$content);

    into for example (off the top of my head, not tested, this could start a thermo-nuclear war)

    $content=preg_replace('/\shttps?:\/\/(www.)?youtu(be.com|.be)\/(watch\?v=)?/','httpv://www.youtube.com/watch?v=',$content);

    This way only links that have a space before them would be turned into a lyte vid (but you’d have to add that space, always in order for lyte to pick that up).

    Thread Starter Kaleyko

    (@kaleyko)

    ah, that’s one of the reasons I don’t like WP YouTube Lyte to automatically parse normal youtube URL’s

    Isn’t this a bug from your side? I’m pretty sure WordPress won’t show embedded YouTube videos if you used a hyperlink, this happens only when this plugin is active.

    And the way you provided won’t be useful.

    I’m not sure what should I do now. I mean what if you decided to stop working in the plugin one day and WordPress updated something? ALL of the YouTube post will be broken, not to mention that the videos won’t show up on the RSS Feed for the readers. (With normal YouTube links you will achieve two things: A) When you stop developing the plugin or someone uninstalled it, video posts will remain working without issues. B) The RSS Feed will detect the normal YouTube video and show it up, too.)

    Thanks so much for your time and your fast replies, but I think you could review the way you developed this plugin to be better for long-terms.

    Not sure if you could help me more than that…

    Plugin Author Frank Goossens

    (@futtta)

    It’s not a bug, as this working WP YouTube Lyte by default only works on httpv-links. I just provided you with some example code that can be used to extend the default behavior and there clearly is room for improvement in that “proof of concept”-code.

    But anyway, as for your dilemma; you can do 3 things:

    1. use wp youtube lyte as is, using httpv-links, which will indeed require you to stick to wp youtube lyte (or other plugins that support httpv)
    2. use the wp youtube lyte API to extend the behavior, based on the example code I provided (it’s a question of tweaking the regular expression, nothing fancy really)
    3. use another youtube-plugin (there are plenty), each with their own advantages and disadvantages off course.

    hope this helps,
    frank

    peter-a

    (@peter-a)

    Hi Frank,

    I really like how well your plugin performs, with greatly improved page-load times, and it also shows the video previews perfectly.

    I also share the same concern as Kaleyko, where I would rather this plugin took any YouTube URL (http or https) that is on a line by itself (but not in a link or on a line with other text) and rendered the lyte YouTube preview… Maybe you can provide the option in a future version?

    For ideas, you can have a look at the Lazy Load for Videos plugin, which has some similar functionality.

    Plugin Author Frank Goossens

    (@futtta)

    For now this is not possible, but as I wrote earlier this can be accomplished by using the API. Actually the example code above only some small tweaks to do what you need it to do 🙂

    peter-a

    (@peter-a)

    Thanks Frank. Unfortunately I am not a programmer, so those small tweaks are beyond my abilities. Maybe someone can tell us how to do it?

    Plugin Author Frank Goossens

    (@futtta)

    ok, ok …

    this seems to work; a youtube-link on a newline is parsed, others (link in a text, link in a href, …) are left alone;

    /** force wp youtube lyte to act on normal youtube url's as well using lyte_content_preparse filter */
    add_filter('lyte_content_preparse','lyte_force_nonhttpv',10,1);
    function lyte_force_nonhttpv($content) {
            $content=preg_replace('/^https?:\/\/(www.)?youtu(be.com|.be)\/(watch\?v=)?/m','httpv://www.youtube.com/watch?v=',$content);
            return $content;
            }

    You might want to test this thoroughly, I’ll add this update to lyte_helper in a next release. You can activate it by following the directions from above and then changing that code a bit to match what is here.

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘This is exactly what I want! But What if I deleted the plugin for some reason?’ is closed to new replies.