远程控制(从网页)远程计算机上的媒体播放器?

发布于 2024-12-21 20:51:58 字数 594 浏览 1 评论 0原文

我只想要一个像控制器这样的界面,它可以控制在远程服务器上播放的某种播放器(Flash 或其他任何东西)的“播放/暂停/停止/..等”,在同一域下通过“HTTP”。

简单来说,我只是想控制远程机器上播放的视频,但“控制器”端必须在网页上。

++ +++++ 网络服务器 ++++++++ <---<---< +++++++ 客户端网页 +++++++++
+++++ 播放视频 ++++++++ ........................ ++++ 使用遥控器 +++++++
+++++++++++++++++++++++++........................ +++[ 播放/停止/下一个/上一个] +++++

  • 有可能吗?
  • 通过服务器播放的播放器通常会显示在“网页”上,但是..是否可以使用某种“桌面播放器”
  • 对于网页,我应该使用哪个“播放器”,Flash 播放器(例如 Flowplayer)/插件(例如 VLC 插件)?


PS:服务器端首选“PHP”

I just want a interface like a controller which can control "Play/Pause/Stop/ ..etc" for some kind of player (Flash or anything else) playing on a remote server, across "HTTP" under same domain.

With simple words, i just wanna control a video playing on a remote machine, but "controller" side must be on a webpage.

+++++++ Web Server ++++++++ <---<---< +++++++ Client Web Page +++++++++
+++++ PLAYING VIDEO ++++++++ .............. ++++ with REMOTE CONTROL +++++++
+++++++++++++++++++++++ ............... +++[ PLAY / STOP / NEXT / PREV ]+++++

  • Is it possible?
  • Player playing over server will be displaying on a "Web Page" normally but.. is it possible for some kind of "Desktop Player" ?
  • For Webpage, which "Player" should i use, A Flash Player (like, Flowplayer) / A Plugin (like, VLC Plugin) ?

P.S: Prefer "PHP" for server side

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

姐不稀罕 2024-12-28 20:51:58

是的,这可以通过 VLC 来完成:

点击:查看 ->添加接口->网页界面
然后在浏览器中访问http://127.0.0.1:8080,第一页控制二进制播放器的播放(就像遥控器一样)。

还有一个巧妙的小功能是 Flash 播放器:http://127.0.0.1:8080/flash.html 它将使用 Flow Player 在页面上流式传输视频,我很确定这就是您想要的。请访问下面的链接,了解有关设置和各种选项的更多信息。
wiki.videolan.org/Interface

Yes this can be done with VLC:

Click: View -> Add Interface -> Web Interface
Then Visit http://127.0.0.1:8080 in your browser, the first page controls the playback of the binary player (Like a remote control).

Also a neat little feature is the flash player: http://127.0.0.1:8080/flash.html it will stream the video on the page with Flow Player, im pretty sure thats what your looking for. Visit the link below for more info about setting it up and the various options.
wiki.videolan.org/Interface

不寐倦长更 2024-12-28 20:51:58

是的,您可以借助 Ajax + jPlayer 来完成此操作。

本质上,您要做的就是在 page1 上设置 jPlayer,以继续调用后端上的 php 文件来检查任何新命令。这是一个伪代码,如果您需要更多帮助,我可以编写实际的代码来实现它。

page1.php

  • 每 5 秒调用 api.php 并期望返回 JSON obj
  • 具有设置功能以将从 AJAX 调用接收到的命令传递给 jPlayer

page2.php

  • 按钮/链接/任何

具有调用 api.php 并设置api.php 的

  • 内容 2 个用途设置和检索数据
  • 当被要求设置数据时,它会向数据库写入命令
  • 当被要求检索数据时,它会查询数据库以查找所有未运行的查询(字段为真/假),然后更新数据库以设置这些命令到“跑”,这样它们只执行一次

下面是实际情况,

  • page1 加载后视频开始播放,同时通过 AJAX 每 5 秒检查 api.php
  • page2 调用 api.php 并告诉它传递命令“ “pause”
  • api 使用命令“pause”更新数据库
  • page1 的 AJAX 调用命中 api.php,后者依次检查数据库,返回“pause”,然后将数据库更新为已运行的“pause”标记

当然知道您将需要防止通过 api.php 进行 SQL 注入,因为您不希望某些攻击者向 api.php 发送虚假命令。为了防止这种情况,我建议将命令(播放、暂停、下一个、上一个、跳到等)列入白名单,以便限制您的脚本的功能。

Yes you can do this with the help of Ajax + jPlayer.

Essentially what you are going to want to do is set up jPlayer on page1 to keep calling a php file on your backend that checks for any new commands. Here it is a pseudo code, if you need more help I can write actual code that does it.

page1.php

  • calls api.php every 5 seconds and expects a JSON obj back
  • has functions setup to pass commands received from the AJAX call to jPlayer

page2.php

  • Has buttons/links/whatever that call api.php and set

api.php

  • 2 purposes, set and retrieve data
  • When asked to set data it writes a command to the DB
  • When asked to retrive data is queries the DB for all un-run queries (Field that is true/false) and then updates the DB to set those command to "ran" so that they are only executed once

Here is how it would look in practice

  • page1 is loaded and video starts playing while checking api.php every 5 seconds via AJAX
  • page2 calls api.php and tells it to pass on the command "pause"
  • api updates the DB with the command "pause"
  • page1's AJAX call hits api.php which in turn checks the DB, returns "pause", then updated the DB the mark "pause" as already ran

Of course know that you will need to protect against SQL injection via api.php as you don't want some attacker to send a fake command to api.php. To protect against this I would suggest whitelisting commands (play, pause, next, prev, skip to, etc) so that there is a limit to what your script is capable of.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文