Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#61 2018-04-24 13:51:21

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

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

Yes, I have applied your code from the forum twice. Unfortunately, the second (replaced) code broked video pages, and upgrade from Github not removed duplicated divs, too. Sorry, I have not saved your first code, and it is replaced now on the forum.

Offline

#62 2018-04-24 14:03:12

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

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

If you can send me an admin access I can quickly take a look, otherwise I can’t do much more for now. It does work for me.

Last edited by NicolasGraph (2018-04-24 14:03:42)


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

Offline

#63 2018-04-24 14:17:50

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

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

I’ve sent, via internal mail of the forum.

Offline

#64 2018-04-24 15:27:17

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

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

All videos play smoothly now, thank you, Nicolas. When sometimes video source stop working, the plugin does not show it, although inserts <div class="grotuvas" /> with no </div>, thus broking webpage. Such cases can occur quite rarely, though, only due an invalid not empty custom field.

Last edited by Vienuolis (2018-04-24 15:28:01)

Offline

#65 2018-04-25 07:28:23

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

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

Vienuolis wrote #311381:

When sometimes video source stop working, the plugin does not show it, although inserts <div class="grotuvas" /> with no </div> […]

Thanks for the report. I’ll try to improve the plugin behavior in such cases in the future.


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

Offline

#66 2018-06-26 14:36:14

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

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

oui_player v2.0.0-BETA1 is released.

The main change is that it is now divided in several plugins…
oui_player stays the main plugin, then oui_provider is needed to extend it as it now comes without any included provider support.

Once these two plugins installed, you are free to add any of the following extension:

This last release also allow to embed players responsively.
Unfortunatly it is not available via Composer for now.


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

Offline

#67 2018-06-28 07:23:53

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

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

Here is oui_provider v1.0.0-BETA2. It should ensure HTML5 valid player embedding.
oui_audio and oui_video should also be updated to their -BETA2 version to beneficiate to this feature.


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

Offline

#68 2018-07-05 13:48:18

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

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

FYI, oui_player, oui_provider and all related extensions have just been released to new Bêta versions.


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

Offline

#69 2018-07-25 10:11:42

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,205
Website GitHub

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

Hi Nicolas,

I’ve been using your updated oui_player to parse vimeo links and it works nicely :-) Thanks for continuing to improve it! I’ve been able to much simplify the previous pasted embed code. Having the preset preferences also makes it much easier for users as it avoids the need to insert code into the admin area, and when they do need to, then with the minimum possible attributes. Nice!

Two questions:

  1. Is it possible to retrieve the respective vimeo video’s aspect ratio? The site I’m working on currently uses a custom field to set widescreen or not in a custom field, e.g. requires user input, but I wonder if that can now be automatically discovered.
  2. I’m facing the same problem of what to do when a user denies cookies / privacy settings and saw your comment here which suggests you may be adding the possibility to “view on cookie consent”. I can, of course, wrap the entire tag in a oui_cookie tag and simply not show the video at all, but I wondered if you’d come up with a better alternative.

I haven’t found a nocookie link for vimeo videos like there is for youtube, so my preference would be to show the vimeo cover image with a click at the moment the page is viewed also sends the user’s browser details to vimeo.

An idea: might it be possible to add a function that hooks into the article_save callback, reads out the video “play” id from the video field (as specified in oui_player prefs) and caches the cover image as a file in the local installation, e.g as the vimeo ID# prefixed with the video-service for later use? In the case of vimeo, the cover image can, I believe, be legally retrieved from an XML file with the video’s ID (as described here). By caching it when saving and then using that image for the “cookie-safe” preview, the user’s browser would only need to make contact with vimeo when the user actually clicks to view.


TXP Builders – finely-crafted code, design and txp

Offline

#70 2018-07-25 13:58:32

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,388
Website GitHub Mastodon Twitter

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

jakob wrote #313128:

2. I’m facing the same problem of what to do when a user denies cookies / privacy settings and saw your comment here which suggests you may be adding the possibility to “view on cookie consent”. I can, of course, wrap the entire tag in a oui_cookie tag and simply not show the video at all, but I wondered if you’d come up with a better alternative.

Hi Julian

From vimeo

Vimeo video player: Vimeo’s embeddable video player uses first-party cookies that we consider essential to the video player experience. We do not use third-party analytics or advertising cookies when our video player appears on a third-party website. (vimeo.com/cookie_policy)

I have mine in a vimeo shorttag found here.

Last edited by colak (2018-07-25 13:59:22)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#71 2018-07-25 15:32:36

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,205
Website GitHub

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

Thanks for the pointer to your shorttag, Yiannis.

Yes, the idea would be, like yours, to not start any interaction with vimeo (or whatever) until the user has either globally given consent (general cookie consent), or decides to override his or her decision to decline consent to see a particular video.

To make that choice (“am I interested in this video?”) a visitor will want to see some idea of what the video is about, otherwise the videos are essentially ‘redacted’ out of the website and are only present as a meaningless link. I think that’s in effect punishing users for opting for personal privacy. And the site owner’s will not be happy to see ‘holes’ in place of what they hoped would be dynamic, compelling content.

In your version, you tackle that by describing what the video contains in words. That’s a valid approach but means more work for site authors. In my case, I’m reworking a site in a language I don’t speak, so I can’t do that myself. The site authors won’t be happy if I tell them they need to provide text descriptions for all their videos.

The intention behind my idea is to pre-fetch the cover images as the site admin when saving the articles, then to show the pre-fetched cover image with a play button and notice to users who have opted out. The end result would be:

  • The site authors’ site looks pretty much the same as it did before
  • The visitors’ experience of the site is similar with two small differences:
    • they don’t reveal themselves to vimeo unless they choose to click and play.
    • there’s an additional notice alongside the play button.

As the cover image was already defined by the video author, so the site authors have no extra work.

Nicolas, what do you think? Is that do-able?


TXP Builders – finely-crafted code, design and txp

Offline

#72 2018-07-26 09:28:06

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

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

jakob wrote #313128:

  1. Is it possible to retrieve the respective vimeo video’s aspect ratio? The site I’m working on currently uses a custom field to set widescreen or not in a custom field, e.g. requires user input, but I wonder if that can now be automatically discovered.

Unfortunatly, it can’t be as for now. To easily embed customized players in the fastest way, oui_player does not use any provider API. Using oembed (it is what is ussually proposed) would permit this kind of thing but would also hit the performance because of the external queries.
I think to add a way to smartly manage providers API for some time, but it still needs some thinking.

I’m facing the same problem of what to do when a user denies cookies / privacy settings and saw your comment here which suggests you may be adding the possibility to “view on cookie consent”. I can, of course, wrap the entire tag in a oui_cookie tag and simply not show the video at all, but I wondered if you’d come up with a better alternative.

I’m afraid that you need to wrap the entire tag for now.
In fact, in parallel of the oui_cookie development, I recently worked on a more generic plugin alternative named oui_globals which is now able to manage $_GET, $_POST, $_COOKIE and $_SESSION. It is during this plugin development that I played with global attributes such as if_cookie. While this plugin base seems to work it still needs to be documented and in theory if_cookie should be named oui_if_cookie. But, anyway, this global attribute would not let you choose an alternative content. To use an else condition you would still need to wrap the entire tag.

I haven’t found a nocookie link for vimeo videos like there is for youtube […]

Yes, I don’t think Vimeo provide this kind of URL.

[…] so my preference would be to show the vimeo cover image with a click at the moment the page is viewed also sends the user’s browser details to vimeo.

An idea: might it be possible to add a function that hooks into the article_save callback, reads out the video “play” id from the video field (as specified in oui_player prefs) and caches the cover image as a file in the local installation, e.g as the vimeo ID# prefixed with the video-service for later use? In the case of vimeo, the cover image can, I believe, be legally retrieved from an XML file with the video’s ID (as described here). By caching it when saving and then using that image for the “cookie-safe” preview, the user’s browser would only need to make contact with vimeo when the user actually clicks to view.

As I previoulsy said, oui_player does not use any API such as the Vimeo one you mentioned (for Youtube and Dailymotion I could add thumbnails like drmonkeyninja in his cakephp-video-helper as image URL’s are predictable).
Your idea to get and save or cache the content provided by an API on saving is interesting, but I guess it should also work when the play attribute is not provided through a field (e.g. video embed in a page or a form). Let me think about that, but do not expect this kind of feature very soon.

Last edited by NicolasGraph (2018-07-26 09:32:39)


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

Offline

#73 2018-07-26 20:54:07

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

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

In fact, Vimeo seems to also have predictible thumbnail URL’s: https://i.vimeocdn.com/video/[ID]_[width].jpg… However the image height is variable.


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

Offline

#74 2018-07-27 08:04:18

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,205
Website GitHub

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

Thanks for your feedback Nicolas!

NicolasGraph wrote #313143:

In fact, Vimeo seems to also have predictible thumbnail URL’s: https://i.vimeocdn.com/video/[ID]_[width].jpg… However the image height is variable.

Yes, it was something like that I was thinking of, except that the the [ID] in your link above is not the same as the video ID. If we take your example above of:

https://vimeo.com/155020267

and do the following to get the image:

https://i.vimeocdn.com/video/155020267_640.jpg

we get a different image. You have to retrieve:

http://vimeo.com/api/v2/video/155020267.xml

which you can download directly without an API key or anything, and you get a small XML file with the video metadata including the following three entries:

<thumbnail_small>https://i.vimeocdn.com/video/682183460_100x75.webp</thumbnail_small>
<thumbnail_medium>https://i.vimeocdn.com/video/682183460_200x150.webp</thumbnail_medium>
<thumbnail_large>https://i.vimeocdn.com/video/682183460_640.webp</thumbnail_large>

Note the ID number is different. It’s not the same as the video. Sometimes the files are also .png files. I have no idea if there’s an algorithmic connection between the thumbnail ID and the video ID that one could use to bypass reading the XML file to get the URL.

My ‘idea’ was to use your video ID detection algorithm from oui_video from within a function that hooks into the article_save callback (or whatever the right callback is when saving an article) and saves the images to a folder (or the DB), e.g. as vimeo_{videoID}_{size}.{ext}.

Then when you come to embed the video for ‘non-cookie users’ (or everyone if you prefer), you show the image, overlay a play symbol and privacy notice. For users with activated js, clicking would embed the iframe as you have it now and play the video. For users without activated js, it would just be a link the vimeo URL opening in a new window. A visitor would therefore not ‘expose themselves’ to vimeo until the click to play but their viewing experience would be largely unchanged.

Incidentally, I just noticed the XML file also contains the video size details from which the video’s aspect ratio could be deduced:

<width>1280</width>
<height>720</height>

TXP Builders – finely-crafted code, design and txp

Offline

#75 2018-07-27 09:42:05

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

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

jakob wrote #313148:

Yes, it was something like that I was thinking of, except that the the [ID] in your link above is not the same as the video ID. […]

Oh, yes, you are right image ID’s are definitly not the same as video ones !

For the rest of your issue/suggestion; I know that API’s provide more useful informations than what you can get from my plugin. My only “shyness” (is google translate right?) is about perfs without cache.

In fact I use the Instagram API in oui_instagram; I needed to add a custom cache system first and then I aborted it, suggesting users to play with aks_cache because of the extra work it required – and in fact, imo, it was kind of “out of feature” anyway. So, I think I will add available API’s support in the future but probably no related storage system. However, depending on how I will proceed, I will consider to add the kind of callbacks you smartly suggested.

For now, here is how I see the future: I will first try to use the API only to guess the player size if two dimensions related values (width, height, ratio) are missing in the prefs/attributes. Then, I will add other features related to API’s contents (I need to see how consistent they are). I guess it will be part of the v3? What do you think?

Edit: sorry, I’m slow today… would you like the callback providing the media ID first? It could be not so long to come. End of the month august I guess.

Last edited by NicolasGraph (2018-07-27 10:12:54)


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

Offline

Board footer

Powered by FluxBB