Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jan 2009
    Posts
    156
    Thanks
    47
    Thanked 0 Times in 0 Posts

    Displaying random YouTube videos ...

    Can someone assist with a code snippet that will randomly display YouTube videos using their embed code?

    PHP Code:
    <iframe width="560" height="315" src="//www.youtube.com/embed/bYI_aOyCn9Y" frameborder="0" allowfullscreen></iframe

    I'd like to cycle through 3-4 videos.

  • #2
    0x3
    0x3 is offline
    New Coder
    Join Date
    Sep 2013
    Location
    Somewhere on a map
    Posts
    37
    Thanks
    0
    Thanked 5 Times in 5 Posts
    Well this could be done client-side, i would suggest looking at the youtube API for Javascript. [LINK: https://developers.google.com/youtube/js_api_reference]
    I would say it would be faster client-side than it would be server-side.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •