Embedded video from browse screen

Hello Cuba community,

My ultimate goal is to launch a video from a browse screen in an embedded iframe. The client would like to be on a browse screen, click a link from the table as described here, and have it launch the target video on the same screen in an iFrame. I don’t even know if this is possible, but would love solutions, if they are out there.

Thanks in advance!,
Adam

You can user browser component.

Hello,

Do you mean BrowserFrame? I don’t see a Browser component in the documentation.

I tried implementing BrowserFrame into the Link component, but it seems that the only thing I can set is:

    @Subscribe
    public void onBeforeShow(BeforeShowEvent event) {
        sOPsTable.addGeneratedColumn("URL", newEntity ->{
            Link link = uiComponents.create(Link.class);
            link.setUrl(newEntity.getUrl());
            link.setCaption(newEntity.getUrl());
            link.setTarget("_blank");
            link.setFrame(some Frame component here);
            return link;
        });
    }

So I’m really not sure of what to try.

Thanks,
Adam

Yep BrowserFrame component. I use this like this link is the reference to vimeo video -

 @Subscribe(id = "chemicalVideosDc", target = Target.DATA_CONTAINER)
    public void onChemicalVideosDcItemChange(InstanceContainer.ItemChangeEvent<ChemicalVideo> event) {
        if (chemicalVideoTable.getSingleSelected() != null) {
            String link = chemicalVideoTable.getSingleSelected().getLink();
            if(!link.isEmpty()) {
                String st = "<iframe src='https://player.vimeo.com/video/" + link + "'" + "width = 100% height = 100% allow=\"autoplay; fullscreen\" allowfullscreen</iframe>";

                byte[] bytes = st.getBytes(StandardCharsets.UTF_8);

                browserFrame.setSource(StreamResource.class)
                        .setStreamSupplier(() -> new ByteArrayInputStream(bytes))
                        .setMimeType("text/html");
            }
        }
    }

This is result -

I appreciate your example, thank you! It’s not exactly how I’m being asked to do it, but it might work. I’ll take it to my PM and see what he says.

Thanks again,
Adam