scrobble.life
HiveDevs

Steemit Condenser Contributions: Refactoring embedded player code

Context

Adding embedded player for video or audio services (Youtube, Vimeo, DTube etc...) to the Condenser has always been a pain with the related logic split into many files making it difficult to maintain.

The purpose of this change is to centralise the logic as much as possible so that we only need to update a couple of files for each new embed player to support.

My 3Speak embedded player support has been approved and deployed recently, this allowed me to complete this work and move the 3Speak code into the new architecture.

Steemit Condenser Contributions

The work done

I moved the logic from the following files:

  • src/app/utils/Links.js
  • src/app/utils/SanitizeConfig.js
  • src/app/utils/SlateEditor/Iframe.js
  • src/shared/HtmlReady.js
  • src/app/components/cards/MarkdownViewer.jsx

Into files located under src/app/components/elements/EmbeddedPlayers. To add a support for a new player, the developer only needs to create a new provider file, for example src/app/components/elements/EmbeddedPlayers/threespeak.jsx and configure it inside the main script src/app/components/elements/EmbeddedPlayers/index.jsx

As seen below, as a result, wherever we needed to call the code for each provider, we now just call a central method EmbeddedPlayerNode() which then do the rest for us.

Condenser Embedded Player code

Steemit Condenser Pull Request

This feature is not out yet, a pull request has been created: https://github.com/steemit/condenser/pull/3704.

Once approved and merged, it will be available in a future release by Steemit Inc.


Vote for my witness Support @quochuy Witness.jpg On Steem, Witnesses are playing the important role of providing a performant and safe network for all of us. You have the power to choose 30 trusty witnesses to package transactions and sign the blocks that will go in the Steem blockchain. Vote for me via SteemConnect to help me do more useful projects for the communities.

Comments · 7

  • @arcange(79)· 2379d

    Congratulations @quochuy! Your post was mentioned in the Steem Hit Parade in the following category:

    • Pending payout - Ranked 4 with $ 67,2
  • @steempeak(72)· 2380d

    You are a wonderful asset to STEEM!

  • @teamhumble(74)· 2381d

    be really great if you could support the oEmbed of Wistia too. i can provide more dev details if you can factor that in. thank you.

  • @ryivhnn(73)· 2381d

    How many different players do you have to support? For things like that definitely seems like a better idea to have it in one spot.

  • @steem-plus(74)· 2381d

    Hi, @quochuy!

    You just got a 0.88% upvote from SteemPlus! To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn. If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

  • @teamvn(55)· 2381d

    Congratulations @quochuy, you have received a 80% upvote. I'm the Vietnamese Community bot developed by witness @quochuy and powered by community SP delegations

  • @jrcornel(82)· 2381d

    Just voted for you.