Coder Social home page Coder Social logo

jrc9designstudio / statamic-video-embed Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 4.0 45 KB

A field type for embedding YouTube and Vimeo Videos

License: MIT License

PHP 52.00% JavaScript 47.76% CSS 0.24%
statamic statamic-v2 statamic-addon video youtube vimeo youtube-api addon vimeo-video responsive-videos

statamic-video-embed's People

Contributors

alexandrada avatar jcohlmeyer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

statamic-video-embed's Issues

Vimeo links can have a second path segment which brakes the embed

Video links that are exposed in certain share dialogs of Vimeo can have two path segments, this breaks the embed.
It seems this happens with private videos that are exposed via a "share" link.

Paste this: https://vimeo.com/680825358/fd410b0271 into the video url field of "statamic-video-embed"

Current behaviour:
breaks because it takes the last path segment even though it should take the first

Expected behaviour:
works because it takes the first path segment

Offer JS Lookup API

Offer a JS Loookup API so custom forms can show video previews (such as Workshop forms).

Video meta data doesn't change with URL

Hey, I think I may have found a bug, but can't be certain.

I'm using a VideoEmbed field to pull in a YouTube video. This worked perfectly, and all the expected meta data came along with it.

I've since changed that video to a Vimeo one. The video itself changes, but all the other meta data (such as title, description, etc) remains the same as the data from the YouTube video.

It would appear to be because no meta data is coming from Vimeo on any of the videos I tested (both on my account and others), and it would also appear that the old meta data from the last video isn't removed, unless there is new data to take it's place.

I'll confess to not knowing PHP, so unfortunately can't help fix it, but thought I'd let you know.

Cheers for the awesome addon by the way!

Vimeo API blocks data on private videos even to a whitelisted URL

Videos "hidden from vimeo.com" which are private protected content do not offer any data to the open API even when attempting to embed on a whitelisted domain.

This means that no data (such as thumbnail URLs) can be pulled as JSON to the addon, essentially rendering it defunct.

The solution would be to implement vimeo API token based authentication in the addon so that it is able to retrieve video metadata and store it to the statamic fieldset entry.

I wish I could help but I lack the coding skills to make this happen.

Make API

To let others create their own tags using the data etc.

youtu.be

youtu.be addresses not recognized.

Get Missing Info via PHP

Get missing info via PHP, this is useful if a video is added via a form not through CP, or the Javascript request fails for some reason.

It will also help with an option to refresh video information.

Download Thumbnails to Assets

Offer an option to download thumbnails to assets.

This will have the benefit of caching glide manipulations done to thumbnails.

Vimeo V3 API & Better Thumbnails

Use the V3 API to get more of the available thumbnails from Vimeo and deduce the larger thumbnail sizes from YouTube based on their url pattern and store them in an array.

Work started here: #9

thumbnails:
  -
    url: https://vimeo.com/thumbnail
    width: 1200
    height: 640
  -
    url: https://vimeo.com/other_thumbnail
    width: 640
    height: 480

Doesn't appear to work with repeating fields

I used the video embed field inside a grid field. When I enter a video URL in one row, it uses that same video URL in all the rows instead of each one keeping the video URL I put in it.

Offer CLI task to refresh video Info

Offer a CLI task to update video Info.

  1. Keep track of pages / entries with videos. Post Save hook(s).
  2. Offer a CLI task to iterate through these pages & entries and fetch new info & save.
  3. Possibly offer a dashboard button to trigger this task (similar to how PowerTools) clears cache.

Error when acces to my entry with video_embed fieldset in CP

fieldtype.js:11 Uncaught (in promise) TypeError: Cannot read property 'key' of undefined
at VideoEmbedFieldtype.data (fieldtype.js:11)
at VideoEmbedFieldtype. (vue.common.js:1796)
at vue.common.js:1802
at VideoEmbedFieldtype.e._initData (vue.common.js:8055)
at VideoEmbedFieldtype.e._initState (vue.common.js:8027)
at VideoEmbedFieldtype.e._init (vue.common.js:2573)
at new VideoEmbedFieldtype (eval at (vue.common.js:10151), :3:54)
at Fr.build (vue.common.js:5963)
at Fr.mountComponent (vue.common.js:5880)
at vue.common.js:5842

Error in Statamic 2.6

Hi!

It looks like the way Statamic allows Addons to extend the functionality has subtly changed in 2.6. To quote their changelog:

"Your extra addon classes should longer extend Addon. Instead, you can should use the Extensible trait to get access to helper methods."

This is causing the following error:

Class Statamic\Addons\VideoEmbed\VideoEmbed may not inherit from final class (Statamic\Extend\Addon)

I'm not particularly proficient in php, otherwise I'd make what I'm sure is a simple change and submit a PR. Failing that, I thought I'd let you know what I've found!

Cheers, Jamie.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.