In this section, you will set some key variables to tailor the app to your requirements:
- Change the
applicationId
from the defaultcom.videodac.hls
- Change the "in-app text" used to guide the user
- Change the parameters used by the app to make payments and request content
You should now have the app imported, and see this screen:
The default applicationId
is com.videodac.hls
. You must change this to something unique to you, otherwise this app with collide with other apps on your device, or in Google Play Store.
- In Android Studio, navigate to
app>java
:
- Right-click on the first
com.videodac.hls
and select "Refactor" then "Rename". When prompted, select to "Rename package":
- Choose the new name for the package and click "Refactor". In this case, we will use
acme
but you can choose whatever you want:
- Once completed, you should see it look like this:
The template shows the following paywall screen to the user, based on the default configuration:
To change this text, open app/res/value/strings.xml
:
- App name (to e.g. "Acme")
- Pay-to address
- Network, from rinkeby, goerli, ropsten, kovan, mainnet, or a custom RPC URL
- price-per-minute in chosen network's native ETH
STREAM_URL
for the video content
You have imported the App and you are at the following screen where these variables can be set (app/res/values/strings.xml
):
For example, you may wish to configure the following values in strings.xml
:
-
App name can be set in the "app_name" field.
-
Pay-to address can be set in the "wallet_address" field.
-
You must set the "infura_url" to choose a network, or this is where you would enter a custom RPC URL.
- To get an infura_rul proceed to https://infura.io and create an account.
- Create a new project.
- You can name the project, and then under keys select the endpoint to be the Ethereum network you wish to use.
- Copy the link that is generated and paste it in the "infura_url" field of the configuration.
-
Open
app/java/com.videodac.hls/helpers/Utils.kt
-
To set the streaming fee, recipient address and STREAM_URL, modify lines 21, 22 and 25 in
Utils.kt
and set the variablesstreamingFeeInEth
,recipientAddress
andSTREAM_URL
- There is a test livestream running at http://52.29.226.43:8935/stream/hello_world.m3u8 if you need a resource
- To find out more about how to create your own STREAM_URL, see Infinite Digital Stage from videoDAC.