Screenshot - Screen capture in Tizen 4 / 6

Hello!

I’m looking for how to capture the html elements of my app. If it is possible to include videos better. All this from the javascripts to be able to send an image to a server.

The TVs are like QM43B Tizen 6 and QM43R Tizen 4 among others.

Thanks for any help.

Use html2Canvas and then store the canvas as a dataurl. (pseudo code)

html2canvas(document.querySelector("#idToCapture"),{
		  }).then(async canvas => {
			let base64String = await canvas.toDataURL('image/png');
			let base64Image = base64String.split(';base64,').pop();

		       // pass to writeData for Tizen 6
                         let arr = Uint8Array.from(Buffer.from(base64Image, 'base64'));
                         let fileHandleWrite = tizen.filesystem.openFile(path, 'rw');
                         fileHandleWrite.writeData(arr);
		         fileHandleWrite.close();

                         // or for Tizen for you'll have to use FileStream
                         // resolve file/get filestream and the annoying T4 stuff..
                        fs.writeBase64(base64Image);
		  });