fix compiling since VideoQuality moved to another file
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
||||
@@ -86,43 +87,36 @@ class _ControlsWidgetState extends State<ControlsWidget> {
|
||||
|
||||
void _enableScreenShare() async {
|
||||
await participant.setScreenShareEnabled(true);
|
||||
// final lp = widget.room.localParticipant;
|
||||
|
||||
// for (final track in lp.videoTracks) {
|
||||
// await lp.unpublishTrack(track.sid);
|
||||
// }
|
||||
|
||||
// try {
|
||||
// // Required for android screenshare.
|
||||
// const androidConfig = FlutterBackgroundAndroidConfig(
|
||||
// notificationTitle: 'Screen Sharing',
|
||||
// notificationText: 'LiveKit Example is sharing the screen.',
|
||||
// notificationImportance: AndroidNotificationImportance.Default,
|
||||
// notificationIcon:
|
||||
// AndroidResource(name: 'livekit_ic_launcher', defType: 'mipmap'),
|
||||
// );
|
||||
// await FlutterBackground.initialize(androidConfig: androidConfig);
|
||||
// await FlutterBackground.enableBackgroundExecution();
|
||||
|
||||
// final screenShareTrack = await LocalVideoTrack.createScreenShareTrack();
|
||||
// await widget.room.localParticipant.publishVideoTrack(
|
||||
// screenShareTrack,
|
||||
// );
|
||||
// } catch (e) {
|
||||
// print('could not publish video: $e');
|
||||
// }
|
||||
if (Platform.isAndroid) {
|
||||
// Android specific
|
||||
try {
|
||||
// Required for android screenshare.
|
||||
const androidConfig = FlutterBackgroundAndroidConfig(
|
||||
notificationTitle: 'Screen Sharing',
|
||||
notificationText: 'LiveKit Example is sharing the screen.',
|
||||
notificationImportance: AndroidNotificationImportance.Default,
|
||||
notificationIcon:
|
||||
AndroidResource(name: 'livekit_ic_launcher', defType: 'mipmap'),
|
||||
);
|
||||
await FlutterBackground.initialize(androidConfig: androidConfig);
|
||||
await FlutterBackground.enableBackgroundExecution();
|
||||
} catch (e) {
|
||||
print('could not publish video: $e');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void _disableScreenShare() async {
|
||||
await participant.setScreenShareEnabled(false);
|
||||
// final lp = widget.room.localParticipant;
|
||||
|
||||
// try {
|
||||
// await lp.setScreenShareEnabled(false);
|
||||
// await FlutterBackground.disableBackgroundExecution();
|
||||
// } catch (e) {
|
||||
// print('error disabling screen share: $e');
|
||||
// }
|
||||
if (Platform.isAndroid) {
|
||||
// Android specific
|
||||
try {
|
||||
// await FlutterBackground.disableBackgroundExecution();
|
||||
} catch (error) {
|
||||
print('error disabling screen share: $error');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void _onTapDisconnect() async {
|
||||
|
||||
@@ -10,8 +10,7 @@ export 'src/participant/local_participant.dart';
|
||||
export 'src/participant/local_participant.dart';
|
||||
export 'src/participant/participant.dart';
|
||||
export 'src/participant/remote_participant.dart';
|
||||
export 'src/proto/livekit_models.pb.dart' show TrackType;
|
||||
export 'src/proto/livekit_rtc.pb.dart' show VideoQuality;
|
||||
export 'src/proto/livekit_models.pb.dart' show TrackType, VideoQuality;
|
||||
export 'src/publication/local_track_publication.dart';
|
||||
export 'src/publication/remote_track_publication.dart';
|
||||
export 'src/publication/track_publication.dart';
|
||||
|
||||
@@ -36,8 +36,8 @@ class RemoteTrackPublication<T extends RemoteTrack>
|
||||
final RemoteParticipant participant;
|
||||
|
||||
bool _enabled = true;
|
||||
lk_rtc.VideoQuality _videoQuality = lk_rtc.VideoQuality.HIGH;
|
||||
lk_rtc.VideoQuality get videoQuality => _videoQuality;
|
||||
lk_models.VideoQuality _videoQuality = lk_models.VideoQuality.HIGH;
|
||||
lk_models.VideoQuality get videoQuality => _videoQuality;
|
||||
|
||||
// used to report renderer visibility to the server
|
||||
// and optimize
|
||||
@@ -173,7 +173,7 @@ class RemoteTrackPublication<T extends RemoteTrack>
|
||||
return didUpdate;
|
||||
}
|
||||
|
||||
set videoQuality(lk_rtc.VideoQuality val) {
|
||||
set videoQuality(lk_models.VideoQuality val) {
|
||||
if (val == _videoQuality) return;
|
||||
_videoQuality = val;
|
||||
_sendUpdateTrackSettings();
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
import 'dart:html' as html;
|
||||
|
||||
// ignore: implementation_imports
|
||||
import 'package:dart_webrtc/src/media_stream_track_impl.dart';
|
||||
import 'package:flutter_webrtc/flutter_webrtc.dart' as rtc;
|
||||
|
||||
// ignore: implementation_imports
|
||||
|
||||
const audioContainerId = 'livekit_audio_container';
|
||||
const audioPrefix = 'livekit_audio_';
|
||||
|
||||
Reference in New Issue
Block a user