Click here to Skip to main content
15,921,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
PHP
<?php
        $ch = '"';
        $dir = "videos/";
        $i = 1;
        //
        if (is_dir($dir)) {
            if ($dh = opendir($dir)) {
                while (($file = readdir($dh)) !== false) {

                    if ($file == ".") {
                        echo '..<br>';
                    } elseif ($file == "..") {
                        echo '..<br>';
                    } else {
                        echo ''.$file.'<br>';
                        echo '<br><video id="vid_' . $i . '" autobuffer preload="auto" style="width:200px;height:300px" src="videos/' . $file . '"  önclick=' . $ch . 'add(this.src)' . $ch . '></video>';
                        
                        $i = $i + 1;
                    }
                }
            }closedir($dh);
        }
        ?>


In my code: the tags: autobuffer preload="auto" are not loading first frame of the video which links also created dynamically.
Actually, I want to create a video-list as like YouTube.
Posted
Updated 28-Apr-13 1:11am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900