我的网站的 flashplayer
假设我在一个文件夹中有 3 个 .flv 文件。我如何创建一个可以从该文件夹读取大量 .flv 文件并播放它们的 flashplayer。例如,如果我向该文件夹添加另外 2 个视频,flashplayer 也会检测到它们,并在名称、日期等之后按时间顺序播放它们。?
只需一些指南或链接来解释如何做到这一点?
提前tnx。
Lets assume i got 3 .flv files in a folder. How can i create a flashplayer which can read the amount of .flv files from that folder and play them. And if example, i add 2 more videos to that folder, the flashplayer will detect them too, and play them chronologically after the name, date, etc.. ??
just need some guide or maybe links which explain how to do this?
tnx in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要某种服务器端代码来读取文件夹并通过 xml 将它们发送到 flash 播放器。 Flash 播放器无法自行扫描文件夹,因为它在浏览器(用户计算机上)而不是服务器上运行。您可以尝试一种 hack(将所有文件命名为 1.flv、2.flv、3.flv 等)并尝试一个接一个地加载它们,直到得到 404 ,但这只是一个丑陋的 hack
you need some kind of serverside code to read the folders and send them to the flash player by xml. the flash player can't scan the folder by itself, because it's running in the browser (on the user's computer) not on the server. you could try a hack (naming all the files something like 1.flv, 2.flv, 3.flv etc. ) and try to load them one by one until you get a 404 , but that's just an ugly hack
恕我直言,正确的流程是:
编写服务器端代码(php、.net、ROR)。
服务器端代码应该“监视”文件夹,返回文件夹中存在的内容的 XML 输出,在这里,您还可以验证文件是否具有 .flv 或 .mp4 扩展名,并仅返回结果。
获得服务器端代码后,在项目的 Flash 部分中,您可以使用 XML 并简单地迭代它以创建数组。
获得服务器端代码后
完成电影播放后,您将进入数组中的下一个索引。
完成
您还可以轻松地以这种方式创建后退>前进按钮,享受迭代数组的能力。
IMHO The right process for this is:
Write server side code (php, .net, ROR).
The server side code should "watch" a folder, returning an XML output of what exist in the folder, here, you can also validate the files have .flv or .mp4 extension and return a result with this only.
After you have the server side code, in the Flash part of the project you consume the XML and simply iterate through it creating an Array.
Once you complete playing a movie, you step to the next index in the array.
Easily, you can also create back>forward buttons in this way enjoying your ability to iterate through the array.