如何在链接中传递参数以打开VLC? [英] How to pass parameter in a link to open VLC?

查看:218
本文介绍了如何在链接中传递参数以打开VLC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个HTML页面,我仅在本地使用.

It's an HTML page which I use only locally.

我有一个指向高清视频的链接,如下所示:

I have a link to a video in my HD like this:

<a href="/path/to/myvideo.mp4">Watch video</a>

单击时,将按预期直接使用VLC启动视频. 现在,我想像在此视频的开始时间一样在内部传递参数.

When clicking it, it launches the video with VLC directly as expected. Now, I'd like to pass parameter inside like the starting time for this video.

例如,在外壳中,您可以执行以下操作:

In the shell for example you can do:

vlc  /path/to/myvideo.mp4 --start-time=126

它将在126秒点开始播放视频.

And it will launches the video at the 126 second point.

我该如何使用HTML链接来做到这一点? 我尝试过例如:

How can I do that with my HTML link? I've tried for example:

<a href="/path/to/myvideo.mp4?start-time=126">Watch video</a>

但是它仍然从视频的开头启动.

But it still launches it from the beginning of the video.

推荐答案

在这一点上,我认为您需要使用某种服务器端包装器/监听器,就像我在相关问题的旧答案插件中所说的那样在现代网络浏览器上不再可用.

At this point I think you would need to use some kind of server-side wrapper/listener, as I had commented in a related question's old answer, the plugin is not available on modern web browsers anymore.

取决于您需要控制启动时间的严重程度(如果需要将其构建到应用程序中),则可以调用通过其Web API的VLC HTTP服务器和远程控制,可在用户桌面上向前播放播放器.如果您采用了某种推送机制,甚至可以通过网络上的常规链接对其进行控制.

Depending on how badly you need to control the start time (and if its a thing you need to build into an application) then you could call the VLC HTTP Server via its web API and remote control to scrub the player forward on the user's desktop. If you had some kind of push mechanism in place you could even control that via a regular link on the web.

我建议将类似Pusher的框架用于Web控件: https://github.com/pusher/pusher-js

I would suggest to combine a framework like Pusher for the web controls: https://github.com/pusher/pusher-js

随后您选择了后端语言以通过HTTP(S)进行侦听,并通过其API(HTTP或本机)远程控制VLC:

Followed by your choice of backend language to listen over HTTP(S), and remote control VLC via its API (either HTTP or native):

  • LibVLC: https://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc.html
  • How to Use VLC Media Player API in a C Program: https://progur.com/2017/06/how-to-use-vlc-api-in-c.html
  • VLCJ -- Java framework for the VLC media player: https://github.com/caprica/vlcj
  • Node.JS -- VLC API: https://github.com/jfhbrook/node-vlc-api .Net
  • Interface to VLC: https://wiki.videolan.org/.Net_Interface_to_VLC
  • PHP/Python/Perl options -- Linux control a running vlc process through command line: Linux control a running vlc process through command line

没有代码选项,只需使用VLC随附的基本Web界面即可:

No code option, just use the basic web interface that comes with VLC: https://www.howtogeek.com/117261/how-to-activate-vlcs-web-interface-control-vlc-from-a-browser-use-any-smartphone-as-a-remote/

这篇关于如何在链接中传递参数以打开VLC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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