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 5 of 5

Thread: video playing

  1. #1
    Regular Coder
    Join Date
    Jun 2012
    Posts
    136
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool video playing

    I have a list of ten videos hosted on youtube.
    What I want to do is, play one, then when it is done, the next video in the list is played.
    Ok I know what you're gonna say. So use a free video player with a playlist.
    Just one problem with that. If a video is blocked for what ever reason by youtube, then the playlist won't work. Or some other message shows up, the video stops and the playlist stops.
    The script that I am using now, apparently bypasses the "blocked" messages and allows the video to be shown.
    I have tried this using the same precise video with both methods.
    The flash video player shows the blocked message while my script does not.

    Is there a way with PHP to do this?

  • #2
    Regular Coder patryk's Avatar
    Join Date
    Oct 2012
    Location
    /dev/couch
    Posts
    398
    Thanks
    2
    Thanked 64 Times in 64 Posts
    how about uploading videos to your server and just using jPlayer or something like that?
    if not, then i guess your only option would be to use youtube's api https://developers.google.com/youtube/

    -------------------------------------------------------------------------------
    "Real Programmers can write assembly code in any language" - Larry Wall

  • #3
    Regular Coder
    Join Date
    Jun 2012
    Posts
    136
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you. Now I understand the errors. You have to be on a server to make it fully functional.

  • #4
    Regular Coder
    Join Date
    Jun 2012
    Posts
    136
    Thanks
    0
    Thanked 0 Times in 0 Posts
    New problem.
    Now that I have the youtube player installed, the rest of the page is blank.
    There should be a table below the video and it does not show.

    PHP Code:

    <?php

    $list
    [0]='<iframe id="ytplayer" type="text/html" width="480" height="270" src="https://www.youtube.com/embed/tSsiS-v6_6M?playlist=Smlaq1ezQRM,mxfljegYXk4,E3meEmDpaDU,kSyYUS92sjw&version=3" frameborder="0" allowfullscreen>';


    $year=$_GET['year'];

    if (empty(
    $year)) {$year=1960;}




    if (
    $year=1960) { echo $list[0]; }


    /* connect to the db */
    $con mysql_connect('localhost','table','password');


    if (!
    $con){die("can not connect: " mysql_error());}

    mysql_select_db('basename',$con);

    $sql="SELECT * FROM A".$year;

    $myData=mysql_query($sql,$con);



    $i=1;
    echo 
    "<table border='1'>";
    echo 
    "<th colspan='3'>".$year."</th>";
    echo 
    "<tr><th></th><th>Title/Flip</th><th>Artist/Label</th></tr>\n";

    while (
    $record mysql_fetch_array($myData)) {
    echo 
    "<tr>";
    echo 
    "<td class='atd'>$i</td>";
    echo 
    "<td class='btd'><div class='blu'><a href='http://mroldies.net/top100-$year.php?number=$i' rel='ajaxpanel' data-loadtype='iframe'>" $record['atitle'] . "</a></div><br>" $record['btitle'] . "</td>";
    echo 
    "<td class='ctd'>" $record['artist'] . "<br>" $record['label'] . "</td>";
    echo 
    "</tr>\n";
    $i++;
    };

    echo 
    "</table>";

    ?>

  • #5
    Regular Coder
    Join Date
    Jun 2012
    Posts
    136
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Solved.
    Moved the table to the proper container.


  •  

    Posting Permissions

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