Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6944701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:20:28+00:00 2026-05-27T13:20:28+00:00

right now i m using this code for playing youtube videos <?php // Replace

  • 0

right now i m using
this code for playing youtube videos

<?php 
  // Replace Youtube URLs with embed code
   function embedYoutube($text)
   {
     $search = '%          # Match any youtube URL in the wild.
    (?:https?://)?    # Optional scheme. Either http or https
    (?:www\.)?        # Optional www subdomain
    (?:               # Group host alternatives
      youtu\.be/      # Either youtu.be,
    | youtube\.com    # or youtube.com
      (?:             # Group path alternatives
        /embed/       # Either /embed/
      | /v/           # or /v/
      | /watch\?v=    # or /watch\?v=
      )               # End path alternatives.
    )                 # End host alternatives.
    ([\w\-]{10,12})   # Allow 10-12 for 11 char youtube id.
    \b                # Anchor end to word boundary.
    %x';

$replace = '<object width="425" height="344">
    <param name="movie" value="http://www.youtube.com/v/$1?fs=1"</param>
    <param name="allowFullScreen" value="true"></param>
    <param name="allowScriptAccess" value="always"></param>
    <embed src="http://www.youtube.com/v/$1?fs=1"
        type="application/x-shockwave-flash" allowscriptaccess="always" width="425" height="344">
    </embed>
    </object>';

return preg_replace($search, $replace, $text);
}

$string = 'This is the forum post content with some Youtube links:'."\n".
'http://www.youtube.com/watch?v=NLqAF9hrVbY'."\n".
'http://www.youtube.com/v/u1zgFlCw8Aw?fs=1&hl=en_US';

echo embedYoutube($string);

?>

but these videos can’t be played in full screen mode as well as these embedded code doesn’t show any info of the video or from where it was taken.

eg. http://www.youtube.com/watch?v=YR12Z8f1Dh8
show video with full screen option
with title
Why This Kolaveri Di Full Song Promo Video in HD
youtube.com

and description like
Chinna Surprise
Check out this exclusive video shot during the recording of the song with the music composer Anirudh,Dhanush,Shruti Hassan, Aishwarya and Sound Engineer Sivakumar

something like as facebook does.

How, to do it any one have any answer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:20:29+00:00Added an answer on May 27, 2026 at 1:20 pm

    Try, allowFullScreen="true" in your embed attributes


    For getting the other video info like description you have to use youtube data api,
    Reference Guide: Data API Protocol

    You can fetch the info from your server side using curl.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to have mysite.com/comment.php?id=sasdfkjsfj redirected to mysite.com/sasdfkjsfj. Right now, i'm using this code
Right now I am using this code to download files (with a Range header).
Right now I am using this code Calendar cal = Calendar.getInstance(); SimpleDateFormat sdf =
I am using this code right now: ProcessStartInfo startInfo = new ProcessStartInfo(); Process process
Right now I am using this to export a repeater (with multiple nested repeaters)
I'm using markdown to edit this question right now. In some wikis I used
I can't find this anywhere in the Ehcache docs. Right now I'm using this
Running a rails site right now using SQLite3. About once every 500 requests or
We are using a Java EE application and we are right now using Informix
Right now we are using PostgreSQL 8.3 (on Linux) as a database backend to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.