diff --git a/bigbluebutton-mobile-sdk.podspec b/bigbluebutton-mobile-sdk.podspec index b25392a..f420166 100644 --- a/bigbluebutton-mobile-sdk.podspec +++ b/bigbluebutton-mobile-sdk.podspec @@ -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" diff --git a/example/ios/BigbluebuttonMobileSdkExample.xcodeproj/project.pbxproj b/example/ios/BigbluebuttonMobileSdkExample.xcodeproj/project.pbxproj index 872f197..dd2e6be 100644 --- a/example/ios/BigbluebuttonMobileSdkExample.xcodeproj/project.pbxproj +++ b/example/ios/BigbluebuttonMobileSdkExample.xcodeproj/project.pbxproj @@ -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; diff --git a/example/ios/BigbluebuttonMobileSdkExample/Info.plist b/example/ios/BigbluebuttonMobileSdkExample/Info.plist index bba9d48..8d82d79 100644 --- a/example/ios/BigbluebuttonMobileSdkExample/Info.plist +++ b/example/ios/BigbluebuttonMobileSdkExample/Info.plist @@ -24,10 +24,6 @@ 1 LSRequiresIPhoneOS - NSMicrophoneUsageDescription - Needs microphone access for streaming your voice when you're joined in full audio mode - NSCameraUsageDescription - Needs camera access for streaming your camera when you're sharing it NSAppTransportSecurity NSAllowsArbitraryLoads @@ -35,8 +31,16 @@ NSExceptionDomains + NSCameraUsageDescription + Needs camera access for streaming your camera when you're sharing it NSLocationWhenInUseUsageDescription + NSMicrophoneUsageDescription + Needs microphone access for streaming your voice when you're joined in full audio mode + UIBackgroundModes + + audio + UILaunchStoryboardName LaunchScreen UIRequiredDeviceCapabilities diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index a259975..810f203 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -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 diff --git a/example/ios/music2.mp3 b/example/ios/music2.mp3 deleted file mode 100644 index bf5fec6..0000000 Binary files a/example/ios/music2.mp3 and /dev/null differ diff --git a/ios/Assets/music2.mp3 b/ios/Assets/music2.mp3 new file mode 100644 index 0000000..a40fb24 Binary files /dev/null and b/ios/Assets/music2.mp3 differ diff --git a/ios/ReactExported/ScreenShareServiceManager.swift b/ios/ReactExported/ScreenShareServiceManager.swift index ec12fdd..0a691cc 100644 --- a/ios/ReactExported/ScreenShareServiceManager.swift +++ b/ios/ReactExported/ScreenShareServiceManager.swift @@ -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() diff --git a/package.json b/package.json index 324f5dd..6098caf 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/index.tsx b/src/index.tsx index 3c00d4f..1e4c342 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -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) => {