Compare commits
2 Commits
bd65038cfc
...
f22c893932
Author | SHA1 | Date | |
---|---|---|---|
f22c893932 | |||
0ccd305d72 |
@ -3,10 +3,12 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_kinetra/kt_pages/kt_actor/kt_actor_page.dart';
|
||||
import 'package:flutter_kinetra/kt_utils/kt_string_extend.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../kt_explore/view.dart';
|
||||
import '../kt_home/view.dart';
|
||||
import '../kt_mine/view.dart';
|
||||
import '../kt_my_list/logic.dart';
|
||||
import '../kt_my_list/view.dart';
|
||||
|
||||
class KtMainPage extends StatefulWidget {
|
||||
@ -103,13 +105,8 @@ class _KtMainPageState extends State<KtMainPage>
|
||||
onTap: (index) {
|
||||
_currentIndex = index;
|
||||
_controller.jumpToPage(index);
|
||||
// final recommendLogic = Get.put(RecommendLogic());
|
||||
// if (index != 1) {
|
||||
// recommendLogic.videoCtrl?.pause();
|
||||
// } else {
|
||||
// recommendLogic.videoCtrl?.play();
|
||||
// }
|
||||
// recommendLogic.update();
|
||||
final myListLogic = Get.put(MyListLogic());
|
||||
myListLogic.initData();
|
||||
},
|
||||
items: [
|
||||
..._tabsTitle.map(
|
||||
|
@ -125,25 +125,7 @@ class MyListLogic extends GetxController {
|
||||
"video_id": video.shortPlayVideoId,
|
||||
};
|
||||
if (video.isCollect == 1) {
|
||||
Get.dialog(
|
||||
KtDialog(
|
||||
title: 'Remove from your list?',
|
||||
subTitle: 'This drama will be removed from your saved list.',
|
||||
rightBtnText: 'Remove',
|
||||
rightBtnIcon: 'ic_dialog_delete.png',
|
||||
rightBtnFunc: () async {
|
||||
ApiResponse res = await KtHttpClient().request(
|
||||
KtApis.deleteFavoriteVideo,
|
||||
data: params,
|
||||
);
|
||||
if (res.success) {
|
||||
video.isCollect = 0;
|
||||
getCollectList(refresh: true);
|
||||
update();
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
cancelCollect(video.shortPlayId!);
|
||||
} else {
|
||||
ApiResponse res = await KtHttpClient().request(
|
||||
KtApis.collectVideo,
|
||||
@ -170,7 +152,7 @@ class MyListLogic extends GetxController {
|
||||
queryParameters: {'short_play_id': id},
|
||||
);
|
||||
if (res.success) {
|
||||
state.favoriteList.removeWhere((item) => id == item.shortPlayId);
|
||||
// state.favoriteList.removeWhere((item) => id == item.shortPlayId);
|
||||
state.chestList.removeWhere((item) => id == item.shortPlayId);
|
||||
state.historyList
|
||||
.firstWhereOrNull((item) => id == item.shortPlayId)
|
||||
|
@ -26,7 +26,7 @@ class _KtMyListPageState extends State<KtMyListPage> {
|
||||
Widget build(BuildContext context) {
|
||||
return GetBuilder<MyListLogic>(
|
||||
builder: (ctrl) {
|
||||
if (state.loadStatus == KtLoadStatusType.loading) return Container();
|
||||
// if (state.loadStatus == KtLoadStatusType.loading) return Center(child: CircularProgressIndicator());
|
||||
return Container(
|
||||
width: ScreenUtil().screenWidth,
|
||||
height: ScreenUtil().screenHeight,
|
||||
|
@ -1,4 +1,6 @@
|
||||
import 'package:easy_debounce/easy_throttle.dart';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_kinetra/kt_pages/kt_mine/logic.dart';
|
||||
@ -12,6 +14,7 @@ import 'package:video_player/video_player.dart';
|
||||
import '../../dio_cilent/kt_apis.dart';
|
||||
import '../../dio_cilent/kt_request.dart';
|
||||
import '../../kt_model/kt_video_detail_bean.dart';
|
||||
import '../../kt_utils/kt_device_info_utils.dart';
|
||||
import '../../kt_widgets/kt_status_widget.dart';
|
||||
import '../../kt_widgets/kt_store_widget.dart';
|
||||
import '../kt_mine/kt_store/logic.dart';
|
||||
@ -222,7 +225,14 @@ class VideoPlayLogic extends GetxController {
|
||||
if (controllers[index] != null) return;
|
||||
|
||||
final episode = state.episodeList[index];
|
||||
final controller = VideoPlayerController.networkUrl(
|
||||
VideoPlayerController controller =
|
||||
Platform.isAndroid && KtDeviceInfoUtil().osVersion == '10'
|
||||
? VideoPlayerController.networkUrl(
|
||||
Uri.parse(episode.videoUrl!),
|
||||
formatHint: VideoFormat.hls,
|
||||
viewType: VideoViewType.platformView,
|
||||
)
|
||||
: VideoPlayerController.networkUrl(
|
||||
Uri.parse(episode.videoUrl!),
|
||||
formatHint: VideoFormat.hls,
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user