scrobble.life
#development

Steemit Condenser contributions: 3Speak embedded player support

3Speak is a relatively new video publishing platform in the Steem ecosystem. However, it was missing an official support in Steemit.com. This work is to allow support for the following requirements:

  • Render an embedded player when you add a plain URL to a valid 3Speak video URL.
  • Allow the use of a valid 3Speak iFrame player
  • Replace 3Speak generated image HTML with their embedded player.

What's involved

What's usually involved in adding support for an embedded video player is a little bit tedious (read repetitive) and I'm planning to find a way to make this simpler in the future:

  1. update helmet directive to allow 3Speak domain names
  2. come up with regular expressions to detect 3Speak URL, video ID and HTML markup
  3. update the MarkdownViewer component to generate the embedded player code
  4. come up with a regular expression to inform the sanitizer whitelist 3Speak's specific iframe code

New logic for embedded players

A new logic was added for 3Speak: replacing their linked image with an embedded player. Up until now, there was only two ways of rendering an embedded player on Steemit.com:

  1. a URL in plain text
  2. an iframe HTML code

However, when a user upload a video on 3Speak, their system creates a blog post with a big image linking to the 3Speak page. The code looks something like this: [![image](http://.../image.jpg)](https://3speak.online/watch?v=wehmoen/xrhjxocx)

The thing is the HTMLReady tool only allows replacement of text nodes but the Mardown code above has already been replaced with its HTML equivalent, hence bypassing HTMLReady. So I had to preprocess the HTML before it gets passed to HTMLReady.

Replacing 3Speak generated code

Plain URL and iframe code


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 · 19

  • @gregorlca(6)· 2385d

    Hi nice post

  • @jekhy(7)· 2433d

    Thanks for the post.

  • @jekhy(7)· 2434d

    Thanks for the post.

  • @steemitboard(66)· 2436d

    Congratulations @quochuy! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

    Your post got the highest payout on one day

    You can view your badges on your Steem Board and compare to others on the Steem Ranking If you no longer want to receive notifications, reply to this comment with the word STOP

    Vote for @Steemitboard as a witness to get one more award and increased upvotes!
  • @arcange(79)· 2436d

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

    • Pending payout - Ranked 1 with $ 121,34
  • @gregorlca(6)· 2436d

    Pals, lets take a poor guy like me and make kn christmas little smile on his face by add some of card or cards on his account like gift from sky...:) just thought.. best regards!

  • @loiphudat(25)· 2437d

    Rất vui khi được đọc những bài viết như vậy!

  • @starkerz(73)· 2437d

    Much appreciated work @quochuy!! It's really fantastic to see this type of development happen organically like this! :)) love Steem!

  • @dokebi(60)· 2437d

    Merry Christmas^^ Happy New Year!

  • @gregorlca(6)· 2437d

    Nice but long

  • @hanggggbeeee(68)· 2437d

    I dont understand most of your work but I know it all awesome. 😁

    Keep it up anh!

  • @steem-plus(74)· 2437d

    Hi, @quochuy!

    You just got a 1.45% 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.

  • @ozannn(49)· 2437d

    Good sharing 👍

  • @fujie(52)· 2437d

    Very good and very interesting. Thank you for informationn @fujie

  • @ssmith(62)· 2437d

    It is good

  • @freevoter(45)· 2437d

    Your post has been manually curated by FreeVoter Team.You can earn liquid steem by delegating SP to @freevoter !! We are now paying 100% daily earnings and 90% curation reward to our delegators !! Join Discord for more information. Thank you !!

  • @steempencil(25)· 2437d

    very interesting...

  • @midlet(74)· 2438d

    This is so sorely needed! Thank You! Just witness voted you via my proxy @theusersparty :)

    I was talking to some other users about pooling money together to have features developed for Condenser. Would you be interested in that?

  • @kingscrown(82)· 2438d

    that will be awesome