当开启页面后则是客户端和服务器的第一次交互,通过http协议得到页面。里面会有流媒体地址的信息,浏览器里面点击显示视频组件。
将流媒体的地址传给流媒体播放器,并启动播放器去请求视频。这是第二次交互。服务器端流媒体服务器发送流给客户端,就实现了页面上播放。
public class TestOne {@SuppressWarnings("unused")
private static void Run(String filePath)
{
Runtime r = Runtime.getRuntime()
try
{
System.out.println(filePath)
r.exec("cmd /c start "+filePath)
} catch (IOException e)
{
e.printStackTrace()
System.out.println(e)
}
}
public static void main(String[] args) {
TestOne.Run("C:\\Users\\whaty\\Desktop\\兰博基尼品牌的视频-YouTubeSnips.mp4")
}
}