admin管理员组

文章数量:1125106

I want to create a javafx app that displays youtube live streams but for some reseaon only live streams dont work with javafx

I am using the java JDK version 23 with javafx version 17.0.6. My controller looks like the following controller

public class HelloController {
    @FXML
    private WebView WebView;

    @FXML
    public void initialize() {
        System.out.println("Controller initialized");

        this.WebView.getEngine().load(";);
    }
}

This code works fine when using a non-livesstream youtube video: .

But when I change the YouTube id to a live stream it will display an error.

And when i right click in the Webview and copy the debug code i get this:

{
  "ns": "yt",
  "el": "embedded",
  "cpn": "icejr63u_l1NkPnr",
  "ver": 2,
  "cmt": "0",
  "fs": "0",
  "rt": "4.348",
  "euri": "",
  "lact": 0,
  "live": "dvr",
  "cl": "712772113",
  "mos": 0,
  "state": "80",
  "volume": 100,
  "cbr": "Safari",
  "cbrver": "614.1",
  "c": "WEB_EMBEDDED_PLAYER",
  "cver": "1.20250106.01.01",
  "cplayer": "UNIPLAYER",
  "cos": "Windows",
  "cosver": "10.0",
  "cplatform": "DESKTOP",
  "autoplay": "1",
  "epm": 1,
  "hl": "en_US",
  "fexp": "v1,24004644,434717,127326,26443548,7111,36343,9954,34656,46919,12193,19100,27818,18053,591,7505,5541,1823,3186,7706,6942,408,20473,8,10631,9243,1581,1690,14,3943,2,120,366,1684,7928,2978,5924,4263,681,6266,2049,45,660,553,3476,2706,1927,334,7764,2286,2084,3964,120,796,31,3313,436,6275,1740,1891,3421",
  "size": "708:463",
  "muted": "0",
  "docid": "w0KulR_3wQk",
  "ei": "yNd-Z-PfLLev6dsPjNO10A8",
  "plid": "AAYrNzga_tFu3iaM",
  "referrer": ";,
  "of": "ftaHEYWD6N0LdddhXd--Ag",
  "vm": "CAEQABgEOjJBSHFpSlRJNl9VUmo4M0FyNDcwMFB5VVVSOUZDWmZuQ2pnMzdINkx5TlBCZjVnbXo4d2JiQUZVQTZSVHV4eVczakNYV0lQc1NWanVLN19GQ21LMElBZjR4T1J6c3dTNTlDbUdVaEN4eDE5dzRTZnZCU2g2X2pOckMxb2Q1Ti1qT3dxSGVROHdPMVVDTzBldndFNzlmSWc",
  "vct": "0.000",
  "vd": "NaN",
  "vpl": "",
  "vbu": "",
  "vbs": "",
  "vpa": "1",
  "vsk": "0",
  "ven": "0",
  "vpr": "1",
  "vrs": "0",
  "vns": "0",
  "vec": "null",
  "vemsg": "",
  "vvol": "1",
  "vdom": "1",
  "vsrc": "0",
  "vw": "0",
  "vh": "0",
  "debug_error": "{\"errorCode\":\"auth\",\"errorMessage\":\"An error occurred. Please try again later.\",\"Gc\":\"GENERIC_WITHOUT_LINK\",\"vp\":\"\",\"Pd\":\"ec.html5.unsupportedlive;ed.;es.;a6s.0\",\"Ve\":2,\"cpn\":\"icejr63u_l1NkPnr\"}",
  "prerolls": "heartbeat",
  "ismb": 34720000,
  "latency_class": "LOW",
  "lowlatency": "1",
  "lat": 0,
  "relative_loudness": "NaN",
  "user_qual": 0,
  "release_version": "youtube.player.web_20250106_01_RC01",
  "debug_videoId": "w0KulR_3wQk",
  "0sz": "true",
  "op": "",
  "yof": "true",
  "dis": "",
  "debug_playbackQuality": "unknown",
  "debug_date": "Wed Jan 08 2025 20:53:48 GMT+0100 (W. Europe Standard Time)",
  "origin": ";,
  "timestamp": 1736366028781
}

This looks like an error from youtube because i get no error in the console. Is there a work around so that i can still display youtube live streams or is this an bug with youtube?

本文标签: javaJavaFX not displaying youtube livestreamsStack Overflow