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
…definitly slow…
jakob wrote #313148:
My ‘idea’ was to use your video ID detection algorithm from oui_video from within a function that hooks into the
article_savecallback (or whatever the right callback is when saving an article) and saves the images to a folder (or the DB), e.g. asvimeo_{videoID}_{size}.{ext}.
In fact, you just want to know how to get the video ID from the custom field value, right?
I will publish a new version in august; variable/methods naming and code documentation will be improved. At the end, you should be able to do something like so:
\Txp::get('Oui\Player')->setMedia($value)->getMediaInfos();
I would like to tell you that it will be online sooner but I leave in two days… Few chances I find the time to finish.
Edit: Also, I don’t know if it fit your needs but the oembed API (the one I will probably support) works with a video URL and includes some video thumbnail related informations.
Last edited by NicolasGraph (2018-07-27 12:37:43)
Offline
Re: oui_player (formerly oui_video) - Easily embed customized players
Hi Nicolas, am a great fan of your plugin, thanx for doing this.
I installed all new versions for 4.7.1 with all separate plugins.
How can i have oui_player always guessing the nature of my link (from custom field), as it was before?
Currently i am using something like
<txp:oui_if_player play='<txp:custom_field name="release_audio_1" />'>
<txp:oui_player class="player" />
</txp:oui_if_player> but the player
• doesn’t show other than in the page source, more importantly though
• it uses the preference from favourite provider to construct it’s player link,
• and the class attribute is not being recognized.
Resulting into something like this
<div style="position: relative; padding-bottom:0px; height: 0; overflow: hidden"><iframe src="//w.soundcloud.com/player/?url=https://soundcloud.com/danielweltlinger/ndr-kultur-weltlinger&hide_related=true&show_artwork=false&show_comments=false&show_reposts=false&show_user=false&single_active=false" style="border: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%" allowfullscreen></iframe></div>
Can the player only rely on guessing and show the class?
Thank you in advance!
Last edited by jayrope (2018-07-27 16:54:04)
A hole turned upside down is a dome, when there’s also gravity.
Offline
Re: oui_player (formerly oui_video) - Easily embed customized players
jayrope wrote #313157:
Can the player only rely on guessing and show the class?
It should.
HI jayrope,
sorry, I’m not able to take a deeper look into your issue for now, and I won’t be able the next few days.
The player is not displayed because of the padding-bottom: 0px. This style attribute is related to the responsive feature but should not be set to 0.
Also, I guess that there could be a problem with the play attribute inheritence. If you can pass its value again in the oui_player tag it could maybe fix the wrong provider.
Could you let me know a value which gives you this kind of result so I will test when possible?
Thanks.
Offline
Re: oui_player (formerly oui_video) - Easily embed customized players
jakob,
if you are still interested in, I just reworked the plugin to introduce a callback event allowing to manipulate media related informations on each rendered player. I also added a player preview under the plugin preference related article field, so you could use its callback event in the admin.
Here are the callback related data inspired by oembed API’s for now:
array(
'provider_name' => 'Vimeo',
'type' => 'video',
'parameters' => array(
'autoplay' => 1
),
'width' => 640,
'height' => 360,
'responsive' => false,
'media' => array(
'https://vimeo.com/59777392' => array(
'id' => '59777392',
'uri' => '59777392',
'pattern' => 0,
)
)
);
The media id and uri may change from one provider to another.
It seems to work but I will need to perform more tests next week as the code changed more than I expected since the last Bêta release date. I will try my best to avoid regressions.
If you are thinking about any other useful information to add, please let me know.
I’m thinking to introduce avilable oembed API’s in the next major release.
Offline
Re: oui_player (formerly oui_video) - Easily embed customized players
jayrope,
Sorry for the delay; your code just seems to work fine in my last code rework.
I will try to through a new pre-release next week.
Feel free to send me more cases to test in the meanwhile.
Last edited by NicolasGraph (2018-08-10 16:05:36)
Offline
Re: oui_player (formerly oui_video) - Easily embed customized players
FYI, oui_player, oui_provider and all related extensions (except oui_vine but including new oui_ted and oui_spotify extensions) have just been released to new Bêta versions.
pluggable_ui() is now used to alterate the plugin output and, for example, facilitate the replacement of a player with an image depending on whatever condition, as Julian asked for.
Here is a Vimeo related basic example to get the right player ratio from the provider oembed API and replace the player with its related thumbnail if the cookie-consent is not set.
# Name: oui_vimeo_plug v0.0.1
# Replace the oui_vimeo player…
# Author: Nicolas Morand
# URL: http://github.com/NicolasGraph
# Recommended load order: 5
# .....................................................................
# This is a plugin for Textpattern - http://textpattern.com/
# To install: textpattern > admin > plugins
# Paste the following text into the "Install plugin" box:
# .....................................................................
H4sIAAAAAAAAE41W/W7bNhD/309xE7JKzhzLrusskeJsQ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g8oxZcrCPIWZbR0rs0ViUMH2RhHt/8u2DFEpRM
Z55RrXBzTprdLvDD5K/sm9Bsvfi3V+JuZ8MDjfdNHt5DKGSuBK81QtGisvlxunCJ2spHMB6N
vt4CMG9fyPgiRNIu/Xjv6z1QbN8nqf5fIJMdirsh+hLsB8n0nkyrTWl/4s0Otzvx99tmbbZC
a9eefPi5pOvtSR33mhNebyp3wkfetLmnCIk744FswclS7dwNztCSftB4FbjbkY5RE08JsU5y
XfDE3SdYNDa3kMgrMutt8jzyTueT+SKbjhZ0epZROpmSsxGZjk/pdPp88uIcr0D3/wKE68T2
aAkAAA==
Edit: the responsive rendering related preference is now provider related. If you are updated from a previous Bêta version, the providers related pref will be added at last. You can delete and re-install extensions to get this pref just under the ratio related one, but in this case, all the provider related preferences will be reset to their initial values.
Last edited by NicolasGraph (2018-08-15 15:16:49)
Offline
Re: oui_player (formerly oui_video) - Easily embed customized players
Thank you Nicolas! I’ve not tried it out yet (was pleased to get the other method working so I’m not going to rock that just yet) but it’s great that you’ve made this possible. I’ll certainly examine it. It would be great to be able to present audio-visual content without necessarily clobbering viewers with trackers when one doesn’t even view or listen to it.
TXP Builders – finely-crafted code, design and txp
Offline
Re: oui_player (formerly oui_video) - Easily embed customized players
jakob wrote #313452:
[…] (was pleased to get the other method working so I’m not going to rock that just yet) but it’s great that you’ve made this possible. I’ll certainly examine it.
You would mainly need to add the CSS+javascript part, as I didn’t work on that.
It would be great to be able to present audio-visual content without necessarily clobbering viewers with trackers when one doesn’t even view or listen to it.
Indeed, it would, I’ll investigate on a way to do it.
Last edited by NicolasGraph (2018-08-16 13:16:38)
Offline
Re: oui_player (formerly oui_video) - Easily embed customized players
jakob,
FYI, I’m updating Vimeo player parameters and the dnt parameter may interest you.
We track all playback sessions to identify bugs and monitor performance in our player. Setting this parameter to true will block the player from tracking any playback session data.
Offline
Offline
Re: oui_player (formerly oui_video) - Easily embed customized players
Hi Nicolas, the issue seems to remain in the BETA4 versions.
I am trying to use it in a context like this
<txp:oui_if_player play='<txp:custom_field name="audio_1" />'>
<txp:oui_player />
<txp:else />
No audio.
</txp:oui_if_player>
But guessing the provider doesn’t work.
My custom field(s) might contain Bandcamp, Mixcloud, Soundcloud links. It is important, that oui_player can guess the provider. I won’t have a default field for players and/or providers, as each of my audio related custom fields must be able to contain Bandcamp, Soundcloud or Mixcloud links (only one per field of course).
V 1.3.3 guessed from this without a problem, but 2.0.0 beta4 doesn’t here. How could this be fixed?
Could you provide me with a working example script eventually?
Thanx a lot!
Last edited by jayrope (2019-01-13 14:46:20)
A hole turned upside down is a dome, when there’s also gravity.
Offline