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