package vassistent.controller;

import vassistent.ui.PixelStreamingView;

/**
 * Exposes basic stream view actions such as reload and focus handling.
 */
public class StreamingController {

    private final PixelStreamingView view;

    /**
     * Creates a streaming controller for the given view.
     *
     * @param view pixel streaming view component
     */
    public StreamingController(PixelStreamingView view) {
        this.view = view;
    }

    /**
     * Loads a new streaming URL in the embedded browser.
     *
     * @param url stream URL to load
     */
    public void reloadStream(String url) {
        view.loadStream(url);
    }

    /**
     * Requests focus for the streaming component (used as a fullscreen shortcut hook).
     */
    public void toggleFullscreen() {
        view.requestFocus();
    }
}
