Coder Social home page Coder Social logo

100mslive / 100ms-react-native Goto Github PK

View Code? Open in Web Editor NEW
80.0 80.0 30.0 89.66 MB

React Native Live Streaming, Video Conferencing SDK & Sample App

Home Page: https://www.100ms.live/

License: MIT License

Java 1.37% JavaScript 3.72% Swift 8.47% C 0.01% Objective-C 1.22% Ruby 0.48% TypeScript 75.66% Starlark 0.08% Kotlin 8.38% Shell 0.04% Makefile 0.05% C++ 0.22% Objective-C++ 0.30%
audio conference ffmpeg hacktoberfest hls live player react react-native rtmp streaming typescript video webrtc

100ms-react-native's Issues

Create wrapper class for HMSPeer

@objcMembers public class HMSPeer : NSObject {

    public let peerID: String

    public var name: String

    public let isLocal: Bool

    public var role: HMSSDK.HMSRole?

    public let customerUserID: String?

    public var customerDescription: String?

    public var audioTrack: HMSAudioTrack?

    public var videoTrack: HMSVideoTrack?

    public var auxiliaryTracks: [HMSTrack]?
}

Implement Preview APIs

public func preview(config: HMSConfig, delegate: HMSPreviewListener)

@objc public protocol HMSPreviewListener: AnyObject {
    @objc(onPreview:localTracks:) func onPreview(room: HMSRoom, localTracks: [HMSTrack])
    @objc(onError:) func on(error: HMSError)
}

Sample app bugs - P3 priority

  • 1. Getting Join a meeting popup every time even after entering my name. Leave meeting and then try to re-join.
  • 2. No camera/mic icon on tile
  • 3. No iPad support
  • 4. No avatar for blank tiles
  • 5. No message notification
  • 6. Tiles are still scrollable.
  • 7. Leave button on right extreme

React Native fixes needed

error Cannot find module 'metro-config/src/defaults/blacklist'

Fix
const blacklist = require('metro-config/src/defaults/exclusionList');

error: Error: Unable to resolve module ../screens/Home

Fix
Rename the /screens/home.js to Home.js

But still ended up continuous errors while trying to run the example project. Is there any working version available?

Implement Role Change APIs

In HMSSDK

    /// Requests a change of role for specified peer.
    /// - Parameters:
    ///   - peer: The peer whose role should be changed.
    ///   - role: The target role.
    ///   - force: False if the peer should be prompted to accept the new role. true if their role should be changed without a prompt.
    ///   - completion: The completion handler to be invoked when the request succeeds or fails with an error.
    public func changeRole(for peer: HMSPeer, to role: HMSRole, force: Bool = false, completion: ((Bool, HMSError?) -> Void)? = nil)

    /// Call to accept the role change request sent to the current peer.
    /// Once this method is called, the peer's role will be changed to the requested one.
    /// - Parameters:
    ///   - request The request that the SDK had sent to this peer (in HMSUpdateListener.onRoleChangeRequest).
    ///   - completion: The completion handler to be invoked when the request succeeds or fails with an error.
    public func accept(changeRole request: HMSRoleChangeRequest, completion: ((Bool, HMSError?) -> Void)? = nil)

    /// To change the mute status of a remote HMSTrack.
    /// - Parameters:
    ///   - remoteTrack: The HMSTrack whose mute status needs to be changed.
    ///   - mute: True if the track needs to be muted, false otherwise.
    ///   - completion: The completion handler to be invoked when the request succeeds or fails with an error.
    public func changeTrackState(for remoteTrack: HMSTrack, mute: Bool, completion: ((Bool, HMSError?) -> Void)? = nil)
In UpdateListener

    /// This is called when a role change request arrives
    /// - Parameter roleChangeRequest: the request for role change info
    @objc(roleChangeRequest:) optional func on(roleChangeRequest: HMSRoleChangeRequest)

    /// This is called when a change track state request arrives
    /// - Parameter changeTrackStateRequest: the request for changing track state
    @objc(changeTrackStateRequest:) optional func on(changeTrackStateRequest: HMSChangeTrackStateRequest)

Create wrapper class for HMSTrack

// HMSTrack

open class HMSTrack : NSObject {

    open var trackId: String { get }

    open var kind: HMSTrack! { get }

    open var source: Int32 { get }

    open var trackDescription: String { get }
    
    open func isMute() -> Bool
}

Implement HMSUpdateListener Callback Wrappers

The callbacks to be included are -

  1. func on(join room: HMSRoom)
  2. func on(room: HMSRoom, update: HMSRoomUpdate)
  3. func on(peer: HMSPeer, update: HMSPeerUpdate)
  4. func on(track: HMSTrack, update: HMSTrackUpdate, for peer: HMSPeer)
  5. func on(error: HMSError)
  6. func on(message: HMSMessage)
  7. func on(updated speakers: [HMSSpeaker])

Create wrapper class for HMSConfig

@objcMembers public class HMSConfig : NSObject {

    /// the name that the user wants to be displayed while in the room
    public let userName: String

    public let userID: String

    public let roomID: String

    /// the auth token to be used
    public let authToken: String

    public let shouldSkipPIIEvents: Bool

    /// any json string or metadata that can be passed while joining
    public let metaData: String?

    /// to override the default endpoint (advanced)
    public let endpoint: String?

    public init(userName: String = "iOS User", userID: String, roomID: String, authToken: String, shouldSkipPIIEvents: Bool = false, metaData: String? = nil, endpoint: String? = nil)
}

Create wrapper class for HMSRole

public struct HMSRole : Codable {

    public let name: String

    public let publishSettings: HMSPublishSettings

    public let subscribeSettings: HMSSubscribeSettings

    public let permissions: HMSPermissions

    public let priority: Int

    public let generalPermissions: [String : String]?

    public let internalPlugins: [String : String]?

    public let externalPlugins: [String : String]?
}

Create wrapper class for HMSRoom

@objcMembers public class HMSRoom : NSObject {

    public let id: String

    public let name: String

    public let metaData: String?

    public var peers: [HMSSDK.HMSPeer]
}

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.