Code Monkey home page Code Monkey logo

aws-samples / amazon-ivs-multi-host-for-android-demo Goto Github PK

View Code? Open in Web Editor NEW
5.0 12.0 2.0 927 KB

This repository contains a collaborative "multi-host" broadcasting application for Android Phones. The app is built on Amazon IVS and uses the Amazon IVS Broadcast SDK to join and broadcast a real-time video call.

Home Page: https://IVS.rocks

License: MIT No Attribution

Kotlin 100.00%
android aws aws-ivs kotlin livestreaming realtime-video ivs-realtime ivs-chat lvl-300

amazon-ivs-multi-host-for-android-demo's Introduction

Amazon IVS Multi-host for Android Demo

A demo Kotlin Android phone application intended as an educational tool to demonstrate how you can build a real-time collaborative live streaming experience with Amazon IVS.

A screenshot of the demo application running on an Android phone.

This project is intended for education purposes only and not for production usage.

Prerequisites

You must have the ApiUrl from the Amazon IVS Multi-host Serverless Demo.

Setup

  1. Clone the repository to your local machine.
  2. Open the repository in Android Studio, or an IDE of your choice.
  3. Open app/build.gradle file and set constants for:
    • Replace <API_URL> with the ApiUrl output from the Amazon IVS Multi-host Serverless Demo. Do NOT remove the escaped quotations \"
    • If you are using Android Studio, the app will ask to sync the project since the gradle file has been changed. Select Sync now to sync.
  4. Run the application on an emulated device or a physical device running API level 33 or later.

IMPORTANT NOTE: Joining a stage and streaming in the app will create and consume AWS resources, which will cost money.

Known Issues

  • This app has only been tested on devices running Android 13 and API level 33 or later. While this app may work on older versions of Android, they have not been extensively tested.
  • A list of known issues for the Amazon IVS Broadcast SDK is available on the following page: Amazon IVS Broadcast SDK: Android Guide

More Documentation

License

This project is licensed under the MIT-0 License. See the LICENSE file.

amazon-ivs-multi-host-for-android-demo's People

Contributors

amazon-auto avatar egorbunovs avatar slee-aws avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amazon-ivs-multi-host-for-android-demo's Issues

Can't release microphone after leave stage

I use below code to list device and set the "publishStreams" into Stage Strategy. When i leave the stage, i can see the camera notification disappear because i detach ImagePreviewView from it's parent. But the audio notification is still on the status bar, like the microphone didn't release. I try to set "AudioLocalStageStream" and "AudioDevice" to null, this issue is still exist. How can i release the audio device if i leave the stage?

SDK version: 'com.amazonaws:ivs-broadcast:1.9.0:stages@aar'

private fun initLocalVideoAndAudioDevice(): ArrayList<LocalStageStream> {
        val publishStreams = arrayListOf<LocalStageStream>()
        val deviceDiscovery = DeviceDiscovery(context)
        val devices = deviceDiscovery.listLocalDevices()

        for (device in devices) {
            val desc = device.descriptor
            if (cameraDevice == null && desc.type == Device.Descriptor.DeviceType.CAMERA && desc.position == Device.Descriptor.Position.FRONT) {
                cameraDevice = device
            }
            if (micDevice == null && desc.type == Device.Descriptor.DeviceType.MICROPHONE) {
                micDevice = device as AudioDevice
            }
        }

        cameraDevice?.let {
            ImageLocalStageStream(it).apply {
                videoStream = this
            }
        }?.also {
            publishStreams.add(it)
        }

        micDevice?.let {
            AudioLocalStageStream(it).apply {
                microphoneStream = this
            }
        }?.also {
            publishStreams.add(it)
        }

        return publishStreams
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.