shareplay
一个用于在 FaceTime 通话中使用 iOS 实时连接 SharePlay 的 Flutter 插件。
一个用于在 FaceTime 通话中使用 iOS 实时连接 SharePlay 📡 的 Flutter 插件 🎥
以下为英文项目原文快照,最新内容请访问 GitHub。
A Flutter plugin to use iOS 15.0+ real-time connection SharePlay on a FaceTime call 🎥.
This plugin use official iOS GroupActivities API.
share_play can be used to communicate data over devices in a Flutter apps using iOS SharePlay features.
Why using iOS SharePlay?
⚠️ share_play is only intended to use with iOS 15.0+! It will simply do nothing on other platform & < iOS 15.0
ℹ️ You can check into the example repository for a full example.
ios/Runner.xcworkspace.Runner app.
share_play & create an instance of the Plugin.import 'package:shareplay/shareplay.dart';
// [...]
final _shareplayPlugin = SharePlay();
initState() method for ex).@override
void initState() {
super.initState();
// [...]
_shareplayPlugin.dataStream().listen((data) {
// do what you want here :)
});
}
_shareplayPlugin.start(title: 'My Activity');
_shareplayPlugin.join();
ℹ️ By tapping on the
SharePlaybanner on top of the screen, you don't need to calljoin()method!
_shareplayPlugin.send('Hello from Flutter');
ℹ️ For more, check documentation below or example.
| Name | Description | Returned value |
|---|---|---|
.start() |
Create an activity when a FaceTime call is active | Future<bool> State of the new activity is created or not |
.join() |
Starts the shared activity on the current device, not necessary if user tap on the SharePlay banner |
Future When a new activity was joined |
.localParticipant() |
Use this property to differentiate the participant on the current device from participants on other devices | Future<SPParticipant?> The participant on the current device including participant id |
.end() |
Ends the activity for the entire group | Future When the activity was stopped |
.leave() |
Leaves the current activity | Future When the activity was leaved |
.send() |
Send a message to all other participants | Future When the message was sent |
.currentSession() |
Get the current session on the device | Future<SPSession?> Current session including session id & activity title |
.dataStream() |
The stream of messages received from other participants | Stream<SPDataModel> Source participant & message data |
.newSessionStream() |
A stream of all created sessions | Stream<SPSession> Created session including session id & activity title |
.participantsStream() |
A stream of all active participants in the current session | Stream<List<SPParticipant>> All active participants in the activity |
.sessionStateStream() |
A stream of the current session state. | Stream<SPSessionState> Session state (SPSessionState.waiting, SPSessionState.joined or SPSessionState.invalidated) |
Contributions are welcome. Contribute by creating a PR or create an issue 🎉.
prepareForActivation() method.依赖清单 4 项
{"sdk":"flutter"}^2.1.8{"sdk":"flutter"}^5.0.0先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗