Naijacrux News:Welcome to Naijacrux Online Forum..Great Place To Get Tips Facts Updates and More ,Interact Discuss & Learn With Others !!.remember to register to enjoy much more update!!!New Updates From Naijacrux -Naijacrux Is Now Mobile Friendly - Download Our Android App On Our Forum Rules And Announcement Section.Our App Will be Live On Google Playstore And IOS Store Soon Aswell - CLICK HERE TO DOWNLOAD NAIJACRUX ANDROID APP !!! Dear Guest And Naijacrux Dedicated Members,!!! ,  You Can Now Receive Naijacrux Weekly New Post and Updates Via Email by Subscribing To Our Newsletter Using The Subscribe Button Above The Naijacrux Announcement And Discussion At The Top Home Page!!Never Miss A New Post And Updates Again.!Thank You.  !!!YOU ARE WELCOME TO NAIJACRUX INFORMATIVE LEARNING AND INTERACTIVE FORUM.This Website is an Intensive Forum of Learning We recommend you Register & Login to Enjoy much free stuffs ::>>Also remember to Update your Profile Immediately after registration. Thank you!>>>!!!!To All Advertisers And Patronizers, kindly Send Mail To Support@naijacrux.com For adverts Placement. thanks!!!


Author Topic: How to Embed YouTube as an Audio Player  (Read 2755 times)

0 Members and 1 Guest are viewing this topic.

Offline newspostng

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1595
  • Karma: +0/-0
How to Embed YouTube as an Audio Player
« on: December 23, 2016, 09:50:12 AM »
Loading...

You can embed any YouTube video in your web pages and visitors on your site will be able to play and pause the video audio with a simple click. With this technique, you can also use a YouTube video as background audio that runs in a loop.


How to Embed YouTube Audio

It takes just one step to embed a YouTube audio. Open any YouTube video and make a note of the YouTube Video ID (a string of 11 characters).

Next copy-paste the code below anywhere on your website and replace VIDEO_ID with actual ID of yourv data-video="VIDEO_ID" 
         data-autoplay="0"         
         data-loop="1"             
         id="youtube-audio">
  </div>
  <script src="https://www.youtube.com/iframe_api"></script>[/greenalert]


There are few other configuration parameters that you can change depending on requirements. For instance, if you set data-autoplay to 1, the audio will begin playing immediately on page load. Likewise, set data-loop to 1 and the audio will play continuously in a never-ending loop until manually stopped.

This internally renders the YouTube video using the IFRAME player and would thus work on both desktop and mobile browsers.

The JavaScript files are hosted on Github while the images are hosted on Imgur. It is recommended that you copy the assets to your own server before deploying on a heavy-traffic website.

YouTube Audio – The Technical Details

We are using the YouTube JavaScript API that renders a regular YouTube player but with the width and height set to 0 pixels. When the user clicks the audio button, it toggles the existing YouTube player state and the video begins to play or pauses.



 

 

how to download youtube videos in small size compressed format

Started by mastercode

Replies: 0
Views: 3360
Last post May 23, 2016, 04:03:51 PM
by mastercode
How To Edit YouTube Video Without Losing Statistics or links

Started by punch

Replies: 0
Views: 16658
Last post August 07, 2019, 05:44:45 AM
by punch
How to Transcribe YouTube Video Files to Text

Started by yungcrux

Replies: 0
Views: 1965
Last post January 16, 2017, 01:14:05 AM
by yungcrux
How to Make a YouTube Video For Beginners

Started by legendguru

Replies: 0
Views: 2095
Last post June 09, 2017, 01:17:49 AM
by legendguru
How to know how much money you can make on Youtube

Started by internet police

Replies: 0
Views: 1868
Last post February 18, 2017, 01:48:58 PM
by internet police