Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2017-04-21 12:24:30

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: oui_player (formerly oui_video) - Easily embed customized players

craigdrown wrote #305374:

Gave it a try and it appears it does require enablejsapi

Ok, thanks, I’ll add it soon with some more parameters.


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#32 2017-04-25 12:45:48

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: oui_player (formerly oui_video) - Easily embed customized players

oui_player v1.3.0-beta-3 is now available.
It allows to enable Youtube, Dailymotion and Vimeo players API’s.


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#33 2017-05-24 09:14:58

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: oui_player (formerly oui_video) - Easily embed customized players

oui_player v1.3.0 is officially out and now available via Composer!


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#34 2017-05-28 07:16:23

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: oui_player (formerly oui_video) - Easily embed customized players

There is a Composer install related issue about non textilized plugin help files.
Prefer Compiled files for now.

Last edited by NicolasGraph (2017-05-28 21:39:08)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#35 2017-07-13 13:37:33

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 328
Website GitHub GitLab Mastodon Twitter

Re: oui_player (formerly oui_video) - Easily embed customized players

It seems that oui_player v1.3.0 ignors a class attribute, e. g. my string

<txp:oui_player provider=“vimeo” play=“97847807” width=“580” height=“464” wraptag=“div” class=“grotuvas” />

interprets as

<div class="Oui\Player\Youtube">
 <div class="Oui\Player\vimeo">
 <iframe width="580" height="464" src="//player.vimeo.com/video/97847807?byline=0&amp;color=008000&amp;portrait=0&amp;title=0" frameborder="0" allowfullscreen=""></iframe>
 </div>

(with no ending </div>).

Not a problem in my case — when I write an outer <div class=""> instead of inner attributes wraptag="" class="", the resulting code is:

<div class="Oui\Player\Youtube"> 
<div class="grotuvas"><iframe width="580" height="464" src="//player.vimeo.com/video/97847807?byline=0&amp;color=008000&amp;portrait=0&amp;title=0" frameborder="0" allowfullscreen=""></iframe></div>

(No ending div, too. Youtube is set there as a default player in oui_player preferences of Textpattern v4.6.2).

Offline

#36 2017-07-13 14:44:39

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: oui_player (formerly oui_video) - Easily embed customized players

Vienuolis wrote #306270:

It seems that oui_player v1.3.0 ignors a class attribute […]

Thanks for the report; v1.3.1 should fix this issue.


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#37 2018-04-22 09:16:39

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 328
Website GitHub GitLab Mastodon Twitter

Re: oui_player (formerly oui_video) - Easily embed customized players

Sorry, I am not a programmer, and can not find any way by coding HTML and CSS. .Oui\Player\youtube{} is invalid in CSS language, and .youtube{} do not work, too. When I set own class="player", the plugin distorts webpages with unclosed <div>:

<div class="player"><txp:oui_player provider="youtube" play="vXo_QN5cYhE" /></div>

becomes

<div  class="Oui\Player\youtube" /> 
 <div class="player"><iframe width="580" height="326.25" src="//www.youtube-nocookie.com/embed/vXo_QN5cYhE?autohide=1&amp;cc_load_policy=0&amp;iv_load_policy=3&amp;rel=0&amp;showinfo=0&amp;theme=light" frameborder="0" allowfullscreen></iframe></div>

— with additional div.

Last edited by Vienuolis (2018-04-22 09:23:23)

Offline

#38 2018-04-22 09:29:26

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,669
Website

Re: oui_player (formerly oui_video) - Easily embed customized players

Vienuolis wrote #311310:

Sorry, I am not a programmer, and can not find any way by coding HTML and CSS. .Oui\Player\youtube{} is invalid in CSS language,

It is valid HTML though…

If you have to use that class, escape the \, like so (CSS 2.1 c4 stuff):

.Oui\\Player\\Youtube { border: 10px solid red;}

Or attribute selectors are your friend: div[class*="Youtube"]

I agree that those generated classes are a bit odd though.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg

Offline

#39 2018-04-22 09:43:34

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 328
Website GitHub GitLab Mastodon Twitter

Re: oui_player (formerly oui_video) - Easily embed customized players

phiw13 wrote #311311:

It is valid HTML though…

Yes, valid, but it changes all remained page structure with no closing </div>

.Oui\\Player\\Youtube { border: 10px solid red;}...

Helped, thank you very much!

Or attribute selectors are your friend: div[class*="Youtube"]

Perhaps the older browsers could not understand…

Offline

#40 2018-04-22 14:19:03

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 328
Website GitHub GitLab Mastodon Twitter

Re: oui_player (formerly oui_video) - Easily embed customized players

I have fixed media, embedded via custom field only. While media provider or sizes are not default, the extra not ending div appears, though. It appears even if there is no txp:oui tag at all — when media is embedded via original iframe! Although divs are not doubling and webpage is not distorting by other embedded txp:oui media, followed after default video, inserted via custom field.

After some research and test, I finally found a pest — <script src="https://platform.vine.co/static/scripts/embed.js"></script>, inserted at the end of a webpage. When I switch TxP form from my media template to another one, doubled <div class="Oui\Player\Youtube"> leaves out.

Offline

#41 2018-04-23 15:48:42

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: oui_player (formerly oui_video) - Easily embed customized players

Vienuolis, the Vine script should not be embed but this was fixed, at least in the dev branch.
However, it should not cause your issue.
About the example provided here, I can’t see how the tag could add a div around the one you code manually (the one with the “player” class)… that is really weird!
Anyway, I can’t reproduce ; do you use the last version?


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#42 2018-04-23 17:11:55

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 328
Website GitHub GitLab Mastodon Twitter

Re: oui_player (formerly oui_video) - Easily embed customized players

Oh, overlooked, sorry. I have upgraded now to the latest 1.3.1 version (was v1.3.0), and not-ending <div> is remained, though. Only when custom field for media is empty — in case of non-default size or provider. When custom field for media is filled in, even subsequent iframe and its wrap tags are correct and clear. Former class Oui\Player\Youtube gone away, now it is replaced with designer-defined word.

Edit: Vine script remained, too.

Last edited by Vienuolis (2018-04-23 19:08:28)

Offline

#43 2018-04-24 07:14:59

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: oui_player (formerly oui_video) - Easily embed customized players

Vienuolis wrote #311336:

Oh, overlooked, sorry. I have upgraded now to the latest 1.3.1 version (was v1.3.0), and not-ending <div> is remained, though. Only when custom field for media is empty […]

I’m not able to reproduce — I would be curious to see your code — but you should test the custom field, otherwise it will through an error in debug mode if it is empty.

<txp:if_custom_field name="video">
    <txp:oui_player />
</txp:if_custom_field>

I will maybe include this test in the oui_if_player tag in the future to perform more tests with less code.

Edit: Vine script remained, too.

Ok, It will be removed in the next version.


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#44 2018-04-24 08:56:12

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 328
Website GitHub GitLab Mastodon Twitter

Re: oui_player (formerly oui_video) - Easily embed customized players

An essence of my txp:article form=“filmai” (films, videos):

		<txp:if_article_list>
...
		<txp:else />
	<dfn class="apie"> <txp:if_description>
<txp:meta_description format="" />.<br /></txp:if_description>
<txp:author link="1" />, <txp:posted />.</dfn>
	<div id="esme">
<h1><txp:title /></h1>
	<txp:oui_if_player>
<txp:oui_player wraptag="div" class="grotuvas" /> <txp:else />
<txp:cfm_videoplayer fieldname="audio-video-vieta:" width="580" height="439" frontcolor="#003300" backcolor="#EEEECC" screencolor="#EEEECC" lightcolor="#009900" class="grotuvas" />
	</txp:oui_if_player>
<txp:body />
<txp:article_image class="vaizdas" html_id="gale" />
	</div><!-- esmė -->
	<dl id="rekvizitai"> ... </dl>
	<p id="galas"> ... </p><!-- galas -->
<txp:output_form form="disqus_talka" />
		</txp:if_article_list>

And a typical txp:oui_player string in an article body, while video is not in default HD format:

<txp:oui_player provider="vimeo" play="227711628" width="580" height="435" wraptag="div" class="grotuvas" />

Interesting: the same strings are converted to iframe correctly, without duplicating divs, while they are following the default video, defined in its custom field (named “audio-video-vieta:”).

An index of video articles is here: on.lt/filmai/

A default video article looks like on.lt/lietuviu-tautos-kilme-2018

A default article with supplementary non-default videos are also shown correctly: on.lt/aerobatika-trio

Only non-default articles with an empty custom field appear with duplicated outer non-ending div, witch I must append with additional </div> every time (in an article body, not a form): on.lt/dangaus-sodai

Offline

#45 2018-04-24 09:41:20

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: oui_player (formerly oui_video) - Easily embed customized players

Vienuolis wrote #311354:

Only non-default articles with an empty custom field appear with duplicated outer non-ending div

Thanks Vienuolis, that is related to what I said before about testing the custom field; oui_if_player can’t work with an empty value for now.
Please try to replace the oui_if_player function with the following, it should avoid you to add a if_custom_field tag:

    function oui_if_player($atts, $thing)
    {
        global $thisarticle, $oui_player_item;

        $player = 'Oui\Player\Main';
        $obj = $player::getInstance();

        // Set tag attributes
        $get_atts = $obj->getAtts(__FUNCTION__);
        $latts = lAtts($get_atts, $atts);
        extract($latts);

        $field = get_pref('oui_player_custom_field');

        if ($play && isset($thisarticle[$play]) && $thisarticle[$play]) {
            $play = $thisarticle[$play];
        } elseif (!$play && isset($thisarticle[$field]) && $thisarticle[$field]) {
            $play = $thisarticle[$field];
        } else {
            $play = false;
        }

        if ($play) {
            // Check if the play attribute value is recognised.
            if ($provider) {
                $player = 'Oui\Player\\' . $provider;
                if (class_exists($player)) {
                    $obj = $player::getInstance();
                } else {
                    trigger_error('Unknown or unset provider: "' . $provider . '".');
                    return;
                }
            }

            $obj->play = $play;
            $oui_player_item = $obj->getInfos();

            $out = parse($thing, $oui_player_item);
            unset($GLOBALS['oui_player_item']);

            return $out;
        }

        return parse($thing, false);
    }

I will include this in the next version.

Last edited by NicolasGraph (2018-04-24 12:29:23)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

Board footer

Powered by FluxBB