Download the PHP package takepart-media/vidiq without Composer

On this page you can find all versions of the php package takepart-media/vidiq. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package vidiq

vidiQ — 3q.video Integration for Statamic

Latest Version on Packagist License PHP Version Statamic

A Statamic addon that integrates the 3q.video hosting platform into the Statamic Control Panel asset browser. Videos hosted on 3q appear as browsable, deletable assets with thumbnail previews. A Blade component is provided for embedding videos in frontend templates.

This addon has only been tested with Statamic 6 and 3Q's SDN API v2.

Features

Requirements

Version compatibility

Addon version Statamic
3.x 6.x
2.x 5.x

Statamic 5 support was dropped in 3.0.0. Statamic 6 rebuilt the Control Panel on Inertia/Vue and removed the Blade chrome the CP Cache Utility relied on (statamic::partials.breadcrumb, the card/btn/badge-pill-sm classes). The utility view is now a fragment built from Statamic 6's global ui-* components, which do not exist in Statamic 5. Projects still on Statamic 5 should stay on ^2.0.

Installation

Install the package via Composer:

Statamic will auto-discover the addon's service provider. No additional registration steps are needed.

Environment variables

Add the following to your .env file:

Asset container

Create content/assets/vidiq.yaml in your Statamic project:

Statamic will display this container as "3Q Videos" in the CP under Assets.

How It Works

Flysystem adapter (ThreeQAdapter)

The adapter connects to the 3Q SDN REST API and implements League\Flysystem\FilesystemAdapter:

Operation Behaviour
listContents Fetches all files from GET /v2/projects/{id}/files and yields FileAttributes. Listing is cached for 1 hour by default (configurable via VIDIQ_CACHE_TTL).
fileExists Resolved from the listing cache.
read For .meta/ paths: returns generated YAML. Direct reads of asset paths are not supported and throw UnableToReadFile.
readStream For .meta/ paths: streams the generated YAML. For asset paths: downloads the video thumbnail from 3Q for Statamic/Glide to cache.
delete Accepted only for .meta/ paths (no-op, virtual files have no remote counterpart). All other paths throw UnableToDeleteFile.
getUrl Calls GET /v2/projects/{id}/files/{fileId}/playouts/default/embed and returns the full FileEmbedCodes array (e.g. JavaScript, PlayerURL). Cached per file ID via VIDIQ_CACHE_TTL.
write / writeStream Accepted only for .meta/ paths. Only the data fields that differ from the 3Q values are kept (permanently, in the vidiQ cache) and merged back in on read, so edits and 3Q updates coexist. All other writes throw UnableToWriteFile.
move, copy, createDirectory, deleteDirectory Not supported; throw the corresponding Flysystem exceptions.

Path convention

Each video's path is its sanitized display title (e.g. My Interview.mp4). If two videos share the same title, the last 6 characters of the FileId are appended to avoid collisions. The FileId→path mapping is stored in the listing cache.

Virtual meta files

listContents also yields a virtual .meta/{path}.yaml entry for every video. This YAML contains:

Statamic reads this file automatically; because the file exists virtually, Statamic skips calling writeMeta() and leaves the adapter's read-only behaviour intact.

CP thumbnails (server-side)

Statamic 6 renders a thumbnail for any asset whose CP payload carries a thumbnail key. 3Q videos have no local file Glide could work on, so the addon hooks the three CP asset resources and passes the 3Q poster URL through:

The poster URL comes from the asset's own meta data (thumbnail_url, written by the adapter's virtual .meta/ file), so no extra request and no client-side patching is involved.

CP player (vidiq_player fieldtype)

The asset editor renders <video :src="asset.url"> for video assets, and a read-only 3Q container has no asset URL. The addon ships a vidiq_player fieldtype instead: it resolves the 3Q player URL server-side in preload() and its Vue component teleports an iframe into the editor's preview column, hiding the core <video>.

Add it to the container's asset blueprint to activate it — see below. Outside the asset editor the field renders inline.

Asset blueprint

Create resources/blueprints/assets/{container}.yaml in your Statamic project:

Blueprint fields are listed before Statamic's own asset columns (File, Size, Last Modified, …), so to move the status column to the end, set the container's column preference — either by reordering the columns in the CP and saving them as default, or in resources/preferences.yaml:

Columns missing from that list are hidden.

release_status is filled from the 3Q metadata (published / unpublished / draft). The vidiq_status fieldtype renders it as a coloured, translated badge — green for published, amber for unpublished, grey for draft — both as a table column in the asset browser and in the asset editor. Labels come from the addon's translations (lang/{locale}/messages.php).

Searchable 3Q metadata

By default Statamic's asset browser only searches the file path, which for 3Q assets means the video title. VIDIQ_METADATA_FIELDS pulls additional fields out of the 3Q Metadata block, stores them as asset data and matches them in the CP search alongside the filename — in the asset browser as well as in the assets fieldtype.

Each key is stored under its snake_cased name, so Category becomes category and ProgramId becomes program_id. Values that 3Q returns as lists of objects (Category, People, …) are flattened to their labels and joined with commas. Empty values are omitted, an empty variable disables the feature.

The fields are captured while the 3Q listing is fetched, so changing the list requires a cache refresh:

Add a field to the blueprint to also show it as a column. Mark it read_only, because edits to asset meta are persisted by the adapter and would then shadow the value coming from 3Q:

Blade Component

<x-vidiq::embed>

Embeds a 3Q video using one of three output methods. The method defaults to the config value vidiq.embed_fallback_method (default: JavaScript).

Props

Prop Type Default Description
asset Statamic\Assets\Asset\|null null The asset object. Renders nothing if null or if no player URL can be resolved.
method string\|null config('vidiq.embed_fallback_method') Embed output method: JavaScript, iFrame, or PlayerURL.

Methods

Value Output
JavaScript Renders the JS embed snippet ({!! $embedCodes['JavaScript'] !!}) provided by 3Q.
iFrame Renders an <iframe> with the PlayerURL as src and the video-embed CSS class.
PlayerURL Outputs only the plain player URL string (useful for custom markup or JS integration).

Configuration

config/vidiq.php (addon)

Key Env variable Default Description
cache.ttl VIDIQ_CACHE_TTL 3600 Cache TTL in seconds for listings and embed codes
cache.permanent VIDIQ_CACHE_PERMANENT false When true, caches are stored forever (ignores TTL)
cache.prefix — vidiq Prefix for all cache keys (scoped per project ID)
embed_fallback_method VIDIQ_FALLBACK_METHOD JavaScript Default embed method (JavaScript, iFrame, PlayerURL)
metadata_fields VIDIQ_METADATA_FIELDS — Comma-separated 3Q metadata keys exposed as asset data and searched in the CP

config/vidiq-disk.php (addon)

Configures the 3q Laravel filesystem disk that is registered automatically by the ServiceProvider. The disk uses the custom 3q driver backed by ThreeQAdapter.

Key Env variable Default Description
api_token VIDIQ_API_TOKEN — 3Q API token
project_id VIDIQ_PROJECT_ID — 3Q project identifier
endpoint VIDIQ_API_ENDPOINT https://sdn.3qsdn.com/api 3Q API base URL
timeout VIDIQ_API_TIMEOUT 30 HTTP timeout in seconds

Multiple Projects

To connect a second 3Q project, add another disk entry in config/filesystems.php and a matching asset container YAML:

After that update .env with the new credentials and clear or refresh caches:

Development

Clone the repository and install dependencies:

Build CP assets

Cache management

CP Utility

The addon registers a vidiQ Cache utility in the Statamic Control Panel under Utilities → vidiQ Cache. It displays the number of cached videos and the current cache mode (TTL or Permanent). Two actions are available:

Warm the cache (CLI)

Pre-populate the video listing cache (and optionally embed codes) so the first frontend request avoids an API round-trip:

This is intended to run once during deployment (e.g. in a post-deploy script or CI pipeline).

Flush caches

The vidiq:warm-cache command automatically flushes all vidiq-specific cache entries (listing, embed codes, meta edits) before re-populating.

License

The MIT License (MIT). Please see the LICENSE file for more information.


All versions of vidiq with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
statamic/cms Version ^6.0
guzzlehttp/guzzle Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package takepart-media/vidiq contains the following files

Loading the files please wait ...