Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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.
Offline
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.
Offline
Re: oui_player (formerly oui_video) - Easily embed customized players
oui_player v1.3.0 is officially out and now available via Composer!
Offline
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)
Offline
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&color=008000&portrait=0&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&color=008000&portrait=0&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
Offline
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&cc_load_policy=0&iv_load_policy=3&rel=0&showinfo=0&theme=light" frameborder="0" allowfullscreen></iframe></div>
— with additional div.
Last edited by Vienuolis (2018-04-22 09:23:23)
Offline
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
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
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
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?
Offline
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
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.
Offline
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
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)
Offline