Skip to content

Latest commit

 

History

History
executable file
·
74 lines (45 loc) · 3.69 KB

index.md

File metadata and controls

executable file
·
74 lines (45 loc) · 3.69 KB

Setting Key Variables

In this section, you will set some key variables to tailor the app to your requirements:

  • Change the applicationId from the default com.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:

Screenshot from 2020-03-08 17-58-10

Change applicationId

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.

  1. In Android Studio, navigate to app>java:

image

  1. Right-click on the first com.videodac.hls and select "Refactor" then "Rename". When prompted, select to "Rename package":

image

  1. Choose the new name for the package and click "Refactor". In this case, we will use acme but you can choose whatever you want:

image

  1. Once completed, you should see it look like this:

image

Change strings.xml

The template shows the following paywall screen to the user, based on the default configuration:

Screenshot_20200308-182730 Screenshot_20200308-182716 Screenshot_20200308-182832

To change this text, open app/res/value/strings.xml:

image

  • 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):

import7

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.

Change Utils.kt

  • 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 variables streamingFeeInEth, recipientAddress and STREAM_URL

Home