Add background audio when screenshare is running

callkit-quick-and-dirty-test
Tiago Jacobs 2 years ago
parent 0f10961c81
commit d0e42c305d

@ -14,6 +14,7 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/bigbluebutton/bigbluebutton-mobile-sdk.git", :tag => "#{s.version}" }
s.source_files = "ios/**/*.{h,m,mm,swift}"
s.resources = "ios/Assets/*"
s.dependency "React-Core"
s.dependency "WebRTC-lib"

@ -320,10 +320,12 @@
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-BigbluebuttonMobileSdkExample/Pods-BigbluebuttonMobileSdkExample-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
"${PODS_ROOT}/../../../ios/Assets/music2.mp3",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/music2.mp3",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;

@ -24,10 +24,6 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSMicrophoneUsageDescription</key>
<string>Needs microphone access for streaming your voice when you're joined in full audio mode</string>
<key>NSCameraUsageDescription</key>
<string>Needs camera access for streaming your camera when you're sharing it</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
@ -35,8 +31,16 @@
<key>NSExceptionDomains</key>
<dict/>
</dict>
<key>NSCameraUsageDescription</key>
<string>Needs camera access for streaming your camera when you're sharing it</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<key>NSMicrophoneUsageDescription</key>
<string>Needs microphone access for streaming your voice when you're joined in full audio mode</string>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>

@ -1,12 +1,12 @@
PODS:
- bigbluebutton-mobile-sdk (0.1.8):
- bigbluebutton-mobile-sdk (0.1.11):
- bigbluebutton-mobile-sdk-common
- React-Core
- WebRTC-lib
- bigbluebutton-mobile-sdk-broadcast-upload-extension (0.1.8):
- bigbluebutton-mobile-sdk-broadcast-upload-extension (0.1.11):
- bigbluebutton-mobile-sdk-common
- WebRTC-lib
- bigbluebutton-mobile-sdk-common (0.1.8):
- bigbluebutton-mobile-sdk-common (0.1.11):
- WebRTC-lib
- boost-for-react-native (1.63.0)
- DoubleConversion (1.1.6)
@ -361,9 +361,9 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"
SPEC CHECKSUMS:
bigbluebutton-mobile-sdk: 3b5da479ad35ed28109cc74b1f8bf7c284e61bb0
bigbluebutton-mobile-sdk-broadcast-upload-extension: a7db971c25db05172529a414b1faf12e410f732a
bigbluebutton-mobile-sdk-common: a230c42cc0f816b44a060a829255fd3900e08e35
bigbluebutton-mobile-sdk: ed5b306bc5161dcc35cf9e870d91ab12c64810b6
bigbluebutton-mobile-sdk-broadcast-upload-extension: af7d83d6e0bd547876f25350b84bc94561ba14cf
bigbluebutton-mobile-sdk-common: 4c14fa0c920d9cd7d57ab2d1aebb8c0ebb0065c4
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
DoubleConversion: cde416483dac037923206447da6e1454df403714
FBLazyVector: 3bb422f41b18121b71783a905c10e58606f7dc3e

Binary file not shown.

Binary file not shown.

@ -7,16 +7,43 @@
import Foundation
import os
import bigbluebutton_mobile_sdk_common
import AVFAudio
@objc(ScreenShareServiceManager)
class ScreenShareServiceManager: NSObject {
// Logger (these messages are displayed in the console application)
private var logger = os.Logger(subsystem: "BigBlueButtonMobileSDK", category: "ScreenShareServiceManager")
var audioSession = AVAudioSession.sharedInstance()
var player: AVAudioPlayer!
// React native exposed method (called when user click the button to share screen)
@objc func initializeScreenShare() -> Void {
logger.info("initializeScreenShare")
Task.init {
do{
try audioSession.setCategory(AVAudioSession.Category.playback, options: [AVAudioSession.CategoryOptions.mixWithOthers])
try audioSession.setPrefersNoInterruptionsFromSystemAlerts(true)
try audioSession.setActive(true)
}catch{
print(error)
}
let path = Bundle.main.path(forResource: "music2", ofType : "mp3")!
let url = URL(fileURLWithPath : path)
print("audioUrl2 = \(url)")
do {
player = try AVAudioPlayer(contentsOf: url)
player.play()
}
catch {
print (error)
}
}
// Request the system broadcast
logger.info("initializeScreenShare - requesting broadcast")
SystemBroadcastPicker.requestBroadcast()

@ -1,6 +1,6 @@
{
"name": "bigbluebutton-mobile-sdk",
"version": "0.1.10",
"version": "0.1.11",
"description": "This repository contains BigBlueButton react-native component, that's used in our [sample implementation](https://github.com/bigbluebutton/bigbluebutton-mobile).",
"main": "lib/commonjs/index",
"module": "lib/module/index",

@ -40,6 +40,7 @@ export const BigBlueButtonMobile = ({
ref={webViewRef}
source={{ uri: url }}
style={{ ...style }}
contentMode={'mobile'}
onMessage={(msg) => handleWebviewMessage(webViewRef, msg)}
applicationNameForUserAgent="BBBMobile"
onLoadEnd={(content: any) => {

Loading…
Cancel
Save