Code Monkey home page Code Monkey logo

amazon-ivs-player-android-sample's Introduction

Amazon IVS Player Android SDK Sample Apps

This repository contains sample apps which use the IVS Player Android SDK.

Samples

  • BasicPlayback: This is the most basic example of how to get started with the SDK.
  • CustomUI: This is a more advanced example that shows how to build a custom UI on top of the SDK.
  • QuizDemo: This is a trivia game example in which the questions are sent over timed metadata embedded in the stream.

Setup

  1. Install and setup Android Studio
  2. Clone the repository to your local machine
  3. Open the project in Android Studio
  4. You can now build and run the sample projects.

Test Streams

License

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

amazon-ivs-player-android-sample's People

Contributors

amazon-auto avatar bclymer avatar caleighm avatar dasmalini avatar iannparker avatar kevineady avatar kstevenu avatar kvasilye avatar michaeljecmen avatar pojach avatar tonyjin avatar willkelleher avatar wongvws avatar wongws avatar

Stargazers

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

Watchers

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

amazon-ivs-player-android-sample's Issues

1.2.0 Regression -> Crash on network type change on android 11

When you try and connect on a non-wifi connection the IVS player crashes.

Likely Cause: Probably related to the android 11 behavior changes for the TelephonyManager#getDataNetworkType() method which requires the Manifest.permission.READ_PHONE_STATE permission. https://developer.android.com/reference/android/telephony/TelephonyManager#getNetworkType()

This is a regression because the crash does not occur in version 1.0.0 but it does occur in version 1.2.0.

CRASH LOG:
A/com.ivsapp: java_vm_ext.cc:577] JNI DETECTED ERROR IN APPLICATION: JNI CallObjectMethodV called with pending exception java.lang.SecurityException: getDataNetworkTypeForSubscriber
java_vm_ext.cc:577] at java.lang.Exception android.os.Parcel.createExceptionOrNull(int, java.lang.String) (Parcel.java:2373)
java_vm_ext.cc:577] at java.lang.Exception android.os.Parcel.createException(int, java.lang.String) (Parcel.java:2357)
java_vm_ext.cc:577] at void android.os.Parcel.readException(int, java.lang.String) (Parcel.java:2340)
java_vm_ext.cc:577] at void android.os.Parcel.readException() (Parcel.java:2282)
java_vm_ext.cc:577] at int com.android.internal.telephony.ITelephony$Stub$Proxy.getNetworkTypeForSubscriber(int, java.lang.String, java.lang.String) (ITelephony.java:8762)
java_vm_ext.cc:577] at int android.telephony.TelephonyManager.getNetworkType(int) (TelephonyManager.java:3021)
java_vm_ext.cc:577] at int android.telephony.TelephonyManager.getNetworkType() (TelephonyManager.java:2985)
java_vm_ext.cc:577] at com.amazonaws.ivs.net.NetworkLinkInfo$CellularNetworkType com.amazonaws.ivs.net.NetworkLinkInfo.getCellularNetworkType() (NetworkLinkInfo.java:97)
java_vm_ext.cc:577] at java.lang.String com.amazonaws.ivs.net.NetworkLinkInfo.getNetworkType() (NetworkLinkInfo.java:70)
java_vm_ext.cc:577]
java_vm_ext.cc:577] in call to CallObjectMethodV
A/com.ivsapp: runtime.cc:655] Runtime aborting...

Conflict with other dependencies

Hello.

Can I use "com.google.android.exoplayer: extension-okhttp:2.10.4" together?
When I add it to the build.gradle of the "basicplayback" app it crashes.
However, downgrading to "com.amazonaws: ivs-player: 1.0.0" works fine.
Let me know if you know a good solution.

Here is the log.

Abort message: 'JNI DETECTED ERROR IN APPLICATION: JNI CallObjectMethodV called with pending exception java.lang.NoSuchMethodError: No static method create([B)Lokhttp3/RequestBody; in class Lokhttp3/RequestBody; or its super classes (declaration of 'okhttp3.RequestBody' appears in /data/app/com.amazonaws.ivs.player.basicplayback-e_2DUrsY1sNcUKN9N2rn4Q==/base.apk)

error.txt

the player can't resume

hello, I working with your player a while, currently I got an issue, if streamer got a network problem in short time (such as switching from wifi to 4g or vise vera ) the player goes into the buffering state, after a while it goes to playing state or even ended state, in both cases the viewer is frozen.
If I implement a mechanism to retry, I got this error **com.amazonaws.ivs.player.PlayerException: Segment : ERROR_NETWORK : 404 : Segment download http error** until 1 minute later.

How to set video render mode?

Hello, does Android SDK have similar API with iOS's playerView.videoGravity, and set to resizeAspectFill mode? Thanks!

Xamarin.Android Support

Is it possible that this player will be available on Xamarin.Android? Or do you plan on adding the official Bindings for Xamarin.Android to the native com.amazonaws.ivs.player library?

exhaustive extension method pollutes auto complete since it isn't marked internal

The library includes an extension T.exhaustive method, likely used internally to make sure when {} calls are exhaustive. The problem is that this method is defined on T and the method is public instead of internal it shows up in the auto complete for every object in every project that depends on this library. It is such a simple method even if the library had to include multiple copies of it in each module and could therefore mark it as internal it would be worth it to avoid exposing it. There are also many other approaches to ensuring when functions are exhaustive (https://github.com/cashapp/exhaustive documents most of them) that wouldn't add a method to the auto complete for every object.

package io.getstream.chat.android.core.internal

@InternalStreamChatApi
public inline val <T> T.exhaustive: T
    get() = this

Caching live-stream videos

Is it possible to pause live stream video and continue from same place where we stopped after some time(10-20 seconds) using your MediaPlayer?

I actually tried to use setMinBuffer, setMaxBuffer and setRebufferToLive methods from com.amazonaws.ivs.player.Player, but they didn't make any effect with next stream https://fcc3ddae59ed.us-west-2.playback.live-video.net/api/video/v1/us-west-2.893648527354.channel.DmumNckWFTqz.m3u8

Can you give any advice or solution to this problem? Thank you in advance

BasicPlayback shows me black screen

Describe the bug
I used other URL in the BasicPlayback sample app, it doesn't work.
I made that VOD by MediaConvert. If it is a problem of VOD, then what's the requirement of playable VOD of this SDK?

To Reproduce

  1. Replace BasicPlayback app's source url with the url provided above.
  2. Allow cleartext traffic.
  3. Build and run.

Expected behavior
VOD should be played when I touch the play button.

Screenshots
Screenshot_20210913-192220_BasicPlayback

Device details (please complete the following information):

  • Device: SM-G996N
  • OS: Android 11

Additional context

Android logcat

2021-09-13 19:28:49.990 9529-9529/com.amazonaws.ivs.player.basicplayback I/PlayerLog: Current state: READY
2021-09-13 19:28:49.993 9529-9529/com.amazonaws.ivs.player.basicplayback I/SurfaceControl: nativeRelease nativeObject s[519971548400]
2021-09-13 19:28:49.993 9529-9529/com.amazonaws.ivs.player.basicplayback I/SurfaceControl: nativeRelease nativeObject e[519971548400]
2021-09-13 19:28:49.993 9529-9529/com.amazonaws.ivs.player.basicplayback I/SurfaceControl: nativeRelease nativeObject s[519971541120]
2021-09-13 19:28:49.993 9529-9529/com.amazonaws.ivs.player.basicplayback I/SurfaceControl: nativeRelease nativeObject e[519971541120]
2021-09-13 19:28:50.088 9529-9529/com.amazonaws.ivs.player.basicplayback I/IVSPlayer: New duration: 26000
2021-09-13 19:28:50.088 9529-9529/com.amazonaws.ivs.player.basicplayback I/PlayerLog: Current state: BUFFERING
2021-09-13 19:28:50.089 9529-9786/com.amazonaws.ivs.player.basicplayback I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2021-09-13 19:28:50.089 9529-9786/com.amazonaws.ivs.player.basicplayback I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2021-09-13 19:28:50.131 9529-9786/com.amazonaws.ivs.player.basicplayback I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2021-09-13 19:28:50.131 9529-9786/com.amazonaws.ivs.player.basicplayback I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2021-09-13 19:28:50.134 9529-9773/com.amazonaws.ivs.player.basicplayback I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2021-09-13 19:28:50.134 9529-9773/com.amazonaws.ivs.player.basicplayback I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
2021-09-13 19:28:50.174 9529-9529/com.amazonaws.ivs.player.basicplayback I/IVSPlayer: New duration: 27000
2021-09-13 19:28:50.188 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err: java.io.InterruptedIOException: thread interrupted
2021-09-13 19:28:50.188 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err:     at com.android.okhttp.okio.Timeout.throwIfReached(Timeout.java:147)
2021-09-13 19:28:50.188 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err:     at com.android.okhttp.okio.Okio$1.write(Okio.java:82)
2021-09-13 19:28:50.188 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err:     at com.android.okhttp.okio.AsyncTimeout$1.write(AsyncTimeout.java:157)
2021-09-13 19:28:50.189 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err:     at com.android.okhttp.okio.RealBufferedSink.flush(RealBufferedSink.java:222)
2021-09-13 19:28:50.189 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err:     at com.android.okhttp.internal.http.Http1xStream.finishRequest(Http1xStream.java:336)
2021-09-13 19:28:50.189 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err:     at com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:898)
2021-09-13 19:28:50.189 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err:     at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:772)
2021-09-13 19:28:50.189 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err:     at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:475)
2021-09-13 19:28:50.189 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err:     at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:411)
2021-09-13 19:28:50.189 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err:     at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:542)
2021-09-13 19:28:50.189 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err:     at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:106)
2021-09-13 19:28:50.189 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err:     at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:30)
2021-09-13 19:28:50.189 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err:     at com.amazonaws.ivs.net.HttpUrlConnectionClient.blockingExecute(HttpUrlConnectionClient.java:103)
2021-09-13 19:28:50.189 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err:     at com.amazonaws.ivs.net.HttpUrlConnectionClient.executeSync(HttpUrlConnectionClient.java:59)
2021-09-13 19:28:50.189 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err:     at com.amazonaws.ivs.net.HttpUrlConnectionClient.access$000(HttpUrlConnectionClient.java:25)
2021-09-13 19:28:50.189 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err:     at com.amazonaws.ivs.net.HttpUrlConnectionClient$1.run(HttpUrlConnectionClient.java:49)
2021-09-13 19:28:50.189 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err:     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
2021-09-13 19:28:50.189 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2021-09-13 19:28:50.189 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
2021-09-13 19:28:50.189 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
2021-09-13 19:28:50.189 9529-9773/com.amazonaws.ivs.player.basicplayback W/System.err:     at java.lang.Thread.run(Thread.java:923)

iOS log

2021-09-13 19:33:47.166237+0900 BasicPlayback[3745:2350578] [connection] nw_endpoint_handler_set_adaptive_read_handler [C1.1 3.36.219.31:80 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for read_timeout failed
2021-09-13 19:33:47.166408+0900 BasicPlayback[3745:2350578] [connection] nw_endpoint_handler_set_adaptive_write_handler [C1.1 3.36.219.31:80 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for write_timeout failed
2021-09-13 19:33:47.466093+0900 BasicPlayback[3745:2350578] [connection] nw_endpoint_handler_set_adaptive_read_handler [C2.1 13.225.125.106:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for read_timeout failed
2021-09-13 19:33:47.466311+0900 BasicPlayback[3745:2350578] [connection] nw_endpoint_handler_set_adaptive_write_handler [C2.1 13.225.125.106:443 ready channel-flow (satisfied (Path is satisfied), viable, interface: en0, ipv4, dns)] unregister notification for write_timeout failed
2021-09-13 19:33:47.544512+0900 BasicPlayback[3745:2350587] [IVSPlayer] TS invalid sync 274 byte(s)
2021-09-13 19:33:47.545211+0900 BasicPlayback[3745:2350587] [IVSPlayer] TS parse error unsupported scrambling control position 278
2021-09-13 19:33:47.576272+0900 BasicPlayback[3745:2350587] [IVSPlayer] TS invalid sync 1805 byte(s)
2021-09-13 19:33:47.576460+0900 BasicPlayback[3745:2350587] [IVSPlayer] TS parse error unsupported scrambling control position 1042
2021-09-13 19:33:47.576648+0900 BasicPlayback[3745:2350587] [IVSPlayer] TS invalid sync 21 byte(s)
2021-09-13 19:33:47.586258+0900 BasicPlayback[3745:2350587] [IVSPlayer] TS invalid sync 71 byte(s)
2021-09-13 19:33:47.586677+0900 BasicPlayback[3745:2350587] [IVSPlayer] TS invalid sync 349 byte(s)
2021-09-13 19:33:47.586919+0900 BasicPlayback[3745:2350587] [IVSPlayer] TS parse error unsupported scrambling control position 612

Player does not change orientation

Description
When the mobile phone switches from for example Portrait to Landscape mode the player still transmits/streams in Portrait mode

To Reproduce

  1. Share sample code
  2. Steps to reproduce

Expected behavior
Would expect the player to detect the change and transmit the frames in Landscape mode or have an API to do so, if the the application can capture the orientation changes and wants to set the mode

Screenshots
If applicable, add screenshots to help explain your problem, e.g. of the player behavior you're seeing or debugger output.

Device details (please complete the following information):

  • Device: Samsung FE 20
  • OS: Android
  • Version 11

Additional context
Add any other context about the problem here.

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.