diff --git a/lib/controllers/post_write_controller.dart b/lib/controllers/post_write_controller.dart index 50ce73d..c20d12b 100644 --- a/lib/controllers/post_write_controller.dart +++ b/lib/controllers/post_write_controller.dart @@ -243,9 +243,13 @@ class PostWriteController extends ChangeNotifier { contentController.text = post.body['content'] ?? ''; aliasController.text = post.alias ?? ''; rewardController.text = post.body['reward']?.toString() ?? ''; - videoAttachment = post.body['video'] != null - ? SnAttachment.fromJson(post.body['video']) - : null; + if (post.body['video'] != null) { + if (post.body['video'] is String) { + videoUrl = post.body['video']; + } else { + videoAttachment = SnAttachment.fromJson(post.body['video']); + } + } publishedAt = post.publishedAt; publishedUntil = post.publishedUntil; visibleUsers = List.from(post.visibleUsersList ?? [], growable: true); @@ -264,6 +268,7 @@ class PostWriteController extends ChangeNotifier { ); poll = post.poll; + videoLive = post.body['is_live'] ?? false; editingDraft = post.isDraft; if (post.body['thumbnail'] != null) { @@ -604,6 +609,7 @@ class PostWriteController extends ChangeNotifier { 'video': videoUrl.isNotEmpty ? videoUrl : videoAttachment!.rid, if (poll != null) 'poll': poll!.id, if (realm != null) 'realm': realm!.id, + if (videoLive) 'is_live': videoLive, 'is_draft': saveAsDraft, }, onSendProgress: (count, total) { diff --git a/lib/screens/post/post_editor.dart b/lib/screens/post/post_editor.dart index 2e39861..55b731b 100644 --- a/lib/screens/post/post_editor.dart +++ b/lib/screens/post/post_editor.dart @@ -1118,8 +1118,6 @@ class _PostVideoEditor extends StatefulWidget { } class _PostVideoEditorState extends State<_PostVideoEditor> { - String? _renderer; - final TextEditingController _streamUrlController = TextEditingController(); void _selectVideo() async { @@ -1296,15 +1294,6 @@ class _PostVideoEditorState extends State<_PostVideoEditor> { onChanged: (value) => widget.controller.setVideoLive(value ?? false), ), - CheckboxListTile( - secondary: const Icon(Symbols.web), - title: Text('postVideoRendererWeb').tr(), - subtitle: Text('postVideoRendererWebDescription').tr(), - value: _renderer == 'web', - onChanged: (value) => setState( - () => _renderer = (value ?? false) ? 'web' : null, - ), - ), ], ), ),