动态创建视频列表时显示视频的第一帧 [英] Show first frame of a video while creating video-list dynamically

查看:163
本文介绍了动态创建视频列表时显示视频的第一帧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<?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我的代码:标签: autobuffer preload =auto没有加载视频的第一帧,这些链接也是动态创建的。

实际上,我想像YouTube一样创建视频列表。



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.

推荐答案

ch = ' < span class =code-string>';
ch = '"';


dir = videos /;
dir = "videos/";


i = 1 ;
//
if (is_dir(
i = 1; // if (is_dir(


这篇关于动态创建视频列表时显示视频的第一帧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆