Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

cloudwebrtc
Copy link
Member

No description provided.

@@ -66,11 +66,16 @@ - (instancetype)initWithChannel:(FlutterMethodChannel *)channel
RTCDefaultVideoDecoderFactory *decoderFactory = [[RTCDefaultVideoDecoderFactory alloc] init];
RTCDefaultVideoEncoderFactory *encoderFactory = [[RTCDefaultVideoEncoderFactory alloc] init];

#if TARGET_OS_IPHONE
Copy link
Member

@hiroshihorie hiroshihorie Oct 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @cloudwebrtc, is it necessary to turn off simulcast for MacOS ? I think the only reason it didn't work was because we are not using the new lib for MacOS.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I haven't tested it yet, under normal circumstances we should be able to use the same code as iOS.

@cloudwebrtc
Copy link
Member Author

I found a symlink problem in the macOS version of WebRTC.framework. The mac version of WebRTC.framework/WebRTC must use a symbolic link to Versions/Current/WebRTC

So I need to publish a new version to Pod

@cloudwebrtc
Copy link
Member Author

image

@hiroshihorie
Copy link
Member

Oh, really! I will check it out now.

@hiroshihorie
Copy link
Member

hiroshihorie commented Oct 16, 2021

the linking etc should be fine, the issue is the simulcast related headers (RTCVideoEncoderFactorySimulcast etc )were not included for mac ver, I will rebuild now 😁.

@hiroshihorie
Copy link
Member

hiroshihorie commented Oct 16, 2021

Ok I wrote a super mini-app to confirm linking/headers are ok. I will publish the new ver.
スクリーンショット 2021-10-17 2 46 52

I wonder what else is missing... ? 😅

@hiroshihorie
Copy link
Member

hiroshihorie commented Oct 16, 2021

Are you sure the structure is incorrect? because Archiving succeeds for both ARM & Intel. Also the sample app runs with Rosetta (intel simulated) mode... (I'm using M1 mac)

スクリーンショット 2021-10-17 3 07 18

@cloudwebrtc
Copy link
Member Author

I'm not sure if the swift project has the same problem. This happened in flutter run -d macos, because during code-signing, if the WebRTC.framework/WebRTC file does not use a symbolic link to the subdirectory, it will cause the flutter app of macos Compilation failed.
image

@cloudwebrtc
Copy link
Member Author

This PR tries to fix the problem of the old version of the symbolic link
https://github.com/flutter-webrtc/flutter-webrtc/pull/690/files

@cloudwebrtc
Copy link
Member Author

Therefore, after your simulcast header file patch is merged, we still need to recompile, and copy the merged WebRTC.framework/WebRTC of the macOS version (intel/m1) to Versions/Current/WebRTC, and create .cxframework again

@hiroshihorie
Copy link
Member

That's interesting, I will check again. #556 This issue was before the new lib, I wonder if the issue still exists with the new lib ?

@hiroshihorie
Copy link
Member

hiroshihorie commented Oct 17, 2021

Seems like something is wrong on the Flutter side, so I guess we need a work around... Everything seems fine with a Swift Xcode project (not Flutter)

@cloudwebrtc
Copy link
Member Author

I have determined that it is indeed caused by a symbolic link. Based on the 92.4515.09 version you released, I adjusted the file structure and created a soft link. All problems have been resolved. Later I will update the compilation instructions and release a new .xcframework version.

@cloudwebrtc cloudwebrtc force-pushed the custom-webrtc-build-for-macos branch from e216ffb to f82401d Compare October 18, 2021 04:23
@cloudwebrtc cloudwebrtc changed the title [WIP] Use pre-compiled WebRTC for macOS. Use pre-compiled WebRTC for macOS. Oct 18, 2021
@cloudwebrtc
Copy link
Member Author

fixed now, I tested it on intel's mac book pro and it passed. Does anyone have an m1 mac for testing and feedback? xD

@cloudwebrtc cloudwebrtc merged commit c47593c into master Oct 18, 2021
@hiroshihorie
Copy link
Member

I'll check it out later!

I wonder if there are any side-effects modifying the framework ?

I feel like it's more of an issue with Flutter / Cocoapods failing to copy files since everything works fine when using Xcode directly.

@cloudwebrtc
Copy link
Member Author

This problem only occurs in the framework signature, but before that, another developer @efraespada submitted an issue and could not upload the app to the Mac store #556. The macOS framework needs to use a symbolic link by default. You can view the WebRTC.framework compiled by webrtc. Before merging into multiple arches, the default is also a symbolic link.

https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html

@cloudwebrtc cloudwebrtc deleted the custom-webrtc-build-for-macos branch October 18, 2021 14:22
yeewang added a commit to ESWIN-DC/flutter-webrtc that referenced this pull request Oct 19, 2021
Use pre-compiled WebRTC for macOS. (flutter-webrtc#717)
@efraespada
Copy link

@cloudwebrtc I'm having this problem when building an iOS release version:

▸ Compiling FlutterWebRTCPlugin.m

❌  /Users/efraespada/.pub-cache/hosted/pub.dartlang.org/flutter_webrtc-0.7.0+hotfix.2/ios/Classes/FlutterWebRTCPlugin.h:8:9: 'WebRTC/WebRTC.h' file not found

#import <WebRTC/WebRTC.h>
                                                              ^~~~~~~~~~~~~~~~~~~


▸ Compiling flutter_webrtc_vers.c
▸ Compiling FlutterRTCVideoRenderer.m

❌  /Users/efraespada/.pub-cache/hosted/pub.dartlang.org/flutter_webrtc-0.7.0+hotfix.2/ios/Classes/FlutterWebRTCPlugin.h:8:9: 'WebRTC/WebRTC.h' file not found

#import <WebRTC/WebRTC.h>
        ^~~~~~~~~~~~~~~~~


▸ Compiling FlutterRTCPeerConnection.m
▸ Compiling FlutterRTCMediaStream.m

❌  /Users/efraespada/.pub-cache/hosted/pub.dartlang.org/flutter_webrtc-0.7.0+hotfix.2/ios/Classes/FlutterRTCMediaStream.m:3:9: 'WebRTC/WebRTC.h' file not found

#import <WebRTC/WebRTC.h>
        ^~~~~~~~~~~~~~~~~

Version flutter_webrtc-0.7.0+hotfix.2

@cloudwebrtc
Copy link
Member Author

hey, did you try running flutter clean and rm -rf ios/{Pods, Podfile*} to compile again?

@efraespada
Copy link

Yes, same error 😕

@cloudwebrtc
Copy link
Member Author

Maybe your pod repo is not updated, so you can’t find the latest WebRTC-SDK.
please try to update the pod repo.

pod update repo

@efraespada
Copy link

I also did that step, before doing pod install.

@cloudwebrtc
Copy link
Member Author

cloudwebrtc commented Oct 28, 2021 via email

@efraespada
Copy link

Yes, I tried it again and same error 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants