1. Outline
The Unifinity application can play videos. This article explains how to play video files obtained via the Internet and videos registered as resources.
Please take a look at the following cases that we can help you with.
- I want to play video files downloaded from the Internet.
- I want to play a video file defined in a resource.
The sample projects used in the explanation can be downloaded from the following links. We hope you will take advantage of it.
2. Operation image
3. Implementation method (explanation of key points only)
3-1. Screen Creation
Create a new screen as follows and place the buttons in it.
(1) Button
3-2. Creating download logic
Create and register logic to be used for downloading.
The logic used for the download is as follows
#1 Logic to download files from the network.
HTTP communication is performed to the URI of the video file to download the file.
The downloaded file will be saved in the application area as "download.mp4".
#2 Play the video file. Specify "download.mp4" obtained in #1 above as the file name and play it.
The created logic should be registered in the "Play Download Video" button.
3-3. Creating Resource Call Logic
Create the logic to call the resource video and set it to a button. You must register your video in the resource in advance.
Resource videos are registered by setting "keywords" from "Properties" > "Resources. keyword is used to invoke a resource.
The logic used for resource loading is as follows
#1 Calls a video from a resource. Specify the keyword you just set for the "Resource KEY" parameter.
The created logic should be registered in the "Play Resource Video" button.
This completes the setup for playing the video.
Run the application from the "Run" button on the menu icon to see if it works correctly.
Press each button and if the video plays on the screen, you have succeeded.