1

Webcam を使用する Web アプリケーションがあります。ブラウザで実行すると動作し、もちろんウェブカメラを使用する許可を求められます。javafxでカメラを要求する方法はありますか?これが私のコードです:

import java.io.IOException;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;

public class Test extends Application {
   @Override
   public void start(Stage stage) throws Exception {
       StackPane root = new StackPane();

       WebView view = new WebView();
       WebEngine engine = view.getEngine();
       engine.load("http://localhost/Step2.html");
       root.getChildren().add(view);

       System.out.println(engine.isJavaScriptEnabled());

       Scene scene = new Scene(root, 800, 600);
       stage.setScene(scene);
       stage.show();
   }

   public static void main(String[] args) throws IOException {
       Application.launch(args);
   }
}

前もって感謝します!!

4

1 に答える 1