npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

datocms-plugin-external-audio-field

v1.2.3

Published

DatoCMS Plugin to add an embedded Mixcloud, Soundcloud, Spotify or Anghami field

Downloads

433

Readme

External Audio Field

DatoCMS npm GitHub Workflow Status (with branch) Netlify NPM Powered By NovemberFive

A DatoCMS plugin that allows content editors to easily embed Soundcloud, Mixcloud, Spotify and Anghami tracks and playlists.

Via the oEmbed standard we'll fetch the embed and meta data for the track. All the information you select is available via the Content Delivery Api.

Created By November Five

Head ups

This package used to be called dato-cms-external-audio-field-plugin but was deprecated in favour of the DatoCMS naming convention, the new package name is now datocms-plugin-external-audio-field

Installation

Install the plugin by following the DatoCMS guide: Installing Marketplace Plugins.

IMPORTANT!!: At the moment Mixcloud does not have the right CORS settings for their /oEmbed endpoint. To solve the you can provide a proxy url through which this plugin will fetch the embed response. We will try to call it with the full oEmbed url as a endpoint query parameter. An example would be

[GET] https://yourProxyApiEndpoint.org?endpoint=endpoint=https://www.mixcloud.com/oembed/?url=https://www.mixcloud.com/MDLBEASTRADIO/mdlbeast-mdlbeast-radio-001/&format=json

If you want more help on the setup of this proxy you can always react out via the Issues

Usage

This is a JSON field extension. So you can use by adding a JSON field:

  1. On the model/block you want to add the field to click New field
  2. In the popup modal select the JSON button.
  3. Give it a sensible name
  4. Select the tab Presentation
  5. In the field editor dropdown select: External Audio Field

In the record field you just copy paste and audio url from one of the supported providers (Soundcloud, Mixcloud, Spotify) and configure it the way you want. Each provider has some different players/options which you can select.

You should end up with something like this:

External Audio Field result

Output:

{
  "oEmbed": {
    "version": 1,
    "type": "rich",
    "provider_name": "SoundCloud",
    "provider_url": "https://soundcloud.com",
    "height": 400,
    "width": "100%",
    "title": "BURN BEAST 001 - DABOUS by MDLBEAST",
    "description": "@waleed-abudabous Is a homegrown Saudi DJ/producer thats been crafting music for five years now and is known for his unique style of mixing various House Music genres ⚡",
    "thumbnail_url": "https://i1.sndcdn.com/artworks-cPivDyutshSD9GQz-wScohg-t500x500.jpg",
    "html": "<iframe width=\"100%\" height=\"160\" scrolling=\"no\" frameborder=\"no\" src=\"https://w.soundcloud.com/player/?height=160&amp;label=Default&amp;show_artwork=true&amp;show_comments=true&amp;url=https%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F1224023323&amp;visual=true\"></iframe>",
    "author_name": "MDLBEAST",
    "author_url": "https://soundcloud.com/mdlbeast"
  },
  "options": {
    "variant": {
      "label": "Default",
      "value": {
        "label": "Default",
        "height": 160
      },
      "defaultToggles": {
        "show_artwork": true,
        "show_comments": false,
        "visual": false
      }
    },
    "toggles": {
      "show_artwork": true,
      "show_comments": true,
      "visual": true
    }
  },
  "url": "https://soundcloud.com/mdlbeast/dabous-1?in=mdlbeast/sets/burn-beast-riyadh-marathon&utm_source=clipboard&utm_medium=text&utm_campaign=social_sharing"
}

Do you know some other options that I forgot? Check the Contributing guide on how to make suggestion for improvements of this plugin! Or you can make a PR if you want.

Contributing

  • Reporting a bug: Open an issue explaining your application's setup and the bug you're encountering.

  • Suggesting an improvement: Open an issue explaining your improvement or feature so we can discuss and learn more.

  • Submitting code changes: For small fixes, feel free to open a pull request with a description of your changes. For large changes, please first open an issue so we can discuss if and how the changes should be implemented.

For more information check the CONTRIBUTING.md document.

License

Copyright (c) November Five BVBA. All rights reserved.

Licensed under the MIT License.