VLC Media Player 初始设置推荐

偏好设置

  • 打开视频时窗口经常跑到屏幕外边了,将“缩放至视频界面大小”去掉就可以保持上一次的窗口大小在这里插入图片描述
  • 如果不喜欢每次播放视频都在屏幕上显示挡视角的文件名,就可以去掉该选项
    在这里插入图片描述

自定义界面

  • 尝试拖动扩展占位符使得下面的按钮居中

在这里插入图片描述
效果如下
在这里插入图片描述

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是Java代码,用于控制VLC Media Player的音量: ``` import java.io.*; import java.net.*; public class VLCControl { public static void main(String[] args) { try { // Connect to VLC web interface URL url = new URL("http://localhost:8080/requests/status.xml"); Authenticator.setDefault(new Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication ("", "password".toCharArray()); } }); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.setRequestProperty("Authorization", "Basic " + new String(Base64.getEncoder().encode(("username" + ":" + "password").getBytes()))); // Get current volume BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream())); String inputLine; int volume = 0; while ((inputLine = in.readLine()) != null) { if (inputLine.contains("<volume>")) { volume = Integer.parseInt(inputLine.substring(inputLine.indexOf("<volume>") + 8, inputLine.indexOf("</volume>"))); break; } } in.close(); // Increase volume volume += 10; // Set new volume String urlParameters = "command=volume&val=" + volume; byte[] postData = urlParameters.getBytes(); int postDataLength = postData.length; URL setVolumeUrl = new URL("http://localhost:8080/requests/status.xml"); HttpURLConnection setVolumeConnection = (HttpURLConnection) setVolumeUrl.openConnection(); setVolumeConnection.setDoOutput(true); setVolumeConnection.setRequestMethod("POST"); setVolumeConnection.setRequestProperty("Authorization", "Basic " + new String(Base64.getEncoder().encode(("username" + ":" + "password").getBytes()))); setVolumeConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); setVolumeConnection.setRequestProperty("Content-Length", Integer.toString(postDataLength)); setVolumeConnection.getOutputStream().write(postData); // Get response BufferedReader setVolumeIn = new BufferedReader(new InputStreamReader(setVolumeConnection.getInputStream())); String setVolumeInputLine; while ((setVolumeInputLine = setVolumeIn.readLine()) != null) { System.out.println(setVolumeInputLine); } setVolumeIn.close(); } catch (Exception e) { e.printStackTrace(); } } } ``` 请注意,您需要将代码中的用户名和密码替换为您在启动VLC设置的用户名和密码。此外,您需要使用正确的端口号(默认为8080)和VLC Web接口URL。 此代码仅适用于VLC 2.0或更高版本。如果您使用的是VLC 1.1.x或更低版本,请使用以下代码: ``` import java.io.*; import java.net.*; public class VLCControl { public static void main(String[] args) { try { // Connect to VLC web interface URL url = new URL("http://localhost:8080/requests/status.xml"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); connection.setRequestProperty("Authorization", "Basic " + new String(Base64.getEncoder().encode(("username" + ":" + "password").getBytes()))); // Get current volume BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream())); String inputLine; int volume = 0; while ((inputLine = in.readLine()) != null) { if (inputLine.contains("<volume>")) { volume = Integer.parseInt(inputLine.substring(inputLine.indexOf("<volume>") + 8, inputLine.indexOf("</volume>"))); break; } } in.close(); // Increase volume volume += 10; // Set new volume String urlParameters = "volume=" + volume; byte[] postData = urlParameters.getBytes(); int postDataLength = postData.length; URL setVolumeUrl = new URL("http://localhost:8080/requests/status.xml?" + urlParameters); HttpURLConnection setVolumeConnection = (HttpURLConnection) setVolumeUrl.openConnection(); setVolumeConnection.setRequestMethod("POST"); setVolumeConnection.setRequestProperty("Authorization", "Basic " + new String(Base64.getEncoder().encode(("username" + ":" + "password").getBytes()))); setVolumeConnection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); setVolumeConnection.setRequestProperty("Content-Length", Integer.toString(postDataLength)); setVolumeConnection.getOutputStream().write(postData); // Get response BufferedReader setVolumeIn = new BufferedReader(new InputStreamReader(setVolumeConnection.getInputStream())); String setVolumeInputLine; while ((setVolumeInputLine = setVolumeIn.readLine()) != null) { System.out.println(setVolumeInputLine); } setVolumeIn.close(); } catch (Exception e) { e.printStackTrace(); } } } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值