home commit
This commit is contained in:
@@ -87,6 +87,7 @@ extension K{
|
||||
static let karaokeListingVC = "KaraokeListingVC"
|
||||
static let karaokeDetailsVC = "KaraokeDetailsVC"
|
||||
static let jwKaraokePlayerVC = "JWKaraokePlayerVC"
|
||||
static let aVPlayerVC = "AVPlayerVC"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -190,34 +190,37 @@ class KaraokeDetailsVC: UIViewController {
|
||||
guard let self else{return}
|
||||
Utilities.startProgressHUD()
|
||||
let sb = UIStoryboard(name: K.StoryBoard.Karaoke, bundle: nil)
|
||||
let vc = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Karaoke.jwKaraokePlayerVC) as! JWKaraokePlayerVC
|
||||
do {
|
||||
|
||||
// Create a JWPlayerItem
|
||||
let item = try JWPlayerItemBuilder()
|
||||
.file(URL(string: itemBuild.url)!)
|
||||
.posterImage(URL(string: itemBuild.poster ?? "")!)
|
||||
.title(itemBuild.titles ?? "Karaoke")
|
||||
.build()
|
||||
|
||||
// Create a JWPlayerConfiguration
|
||||
let config = try JWPlayerConfigurationBuilder()
|
||||
.playlist(items: [item])
|
||||
.autostart(true)
|
||||
.build()
|
||||
|
||||
vc.config = config
|
||||
// vc.dismissTapped = self.tapped
|
||||
vc.modalPresentationStyle = .overFullScreen
|
||||
vc.modalTransitionStyle = .crossDissolve
|
||||
vc.documentAudioUrl = url
|
||||
Utilities.dismissProgressHUD()
|
||||
// Present the PlayerVC
|
||||
self.present(vc, animated: true)
|
||||
} catch {
|
||||
print("Error creating JWPlayer configuration: \(error)")
|
||||
Utilities.dismissProgressHUD()
|
||||
}
|
||||
let vc = sb.instantiateViewController(withIdentifier: K.StoryBoardID.Karaoke.aVPlayerVC) as! AVPlayerVC
|
||||
vc.videoURL = itemBuild.url
|
||||
vc.modalPresentationStyle = .fullScreen
|
||||
self.present(vc, animated: true)
|
||||
// do {
|
||||
//
|
||||
// // Create a JWPlayerItem
|
||||
// let item = try JWPlayerItemBuilder()
|
||||
// .file(URL(string: itemBuild.url)!)
|
||||
// .posterImage(URL(string: itemBuild.poster ?? "")!)
|
||||
// .title(itemBuild.titles ?? "Karaoke")
|
||||
// .build()
|
||||
//
|
||||
// // Create a JWPlayerConfiguration
|
||||
// let config = try JWPlayerConfigurationBuilder()
|
||||
// .playlist(items: [item])
|
||||
// .autostart(true)
|
||||
// .build()
|
||||
//
|
||||
// vc.config = config
|
||||
// // vc.dismissTapped = self.tapped
|
||||
// vc.modalPresentationStyle = .overFullScreen
|
||||
// vc.modalTransitionStyle = .crossDissolve
|
||||
// vc.documentAudioUrl = url
|
||||
// Utilities.dismissProgressHUD()
|
||||
// // Present the PlayerVC
|
||||
// self.present(vc, animated: true)
|
||||
// } catch {
|
||||
// print("Error creating JWPlayer configuration: \(error)")
|
||||
// Utilities.dismissProgressHUD()
|
||||
// }
|
||||
|
||||
// Dismiss the progress HUD after the view controller presentation
|
||||
Utilities.dismissProgressHUD()
|
||||
|
||||
@@ -159,6 +159,7 @@ extension KaraokeListingVC : TableViewSRC{
|
||||
|
||||
|
||||
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
if vm.karaokeListData.count == 0 {return}
|
||||
let data = vm.karaokeListData[indexPath.row]
|
||||
|
||||
/*
|
||||
|
||||
@@ -138,7 +138,7 @@ class KaraokeListingVM{
|
||||
self.vc.karaokeListingTableView.reloadData()
|
||||
self.vc.tableHeight.constant = self.vc.karaokeListingTableView.contentSize.height + 100
|
||||
self.vc.karaokeListingTableView.layoutIfNeeded()
|
||||
self.vc.tableHeight.constant = self.vc.karaokeListingTableView.contentSize.height + 200
|
||||
self.vc.tableHeight.constant = self.vc.karaokeListingTableView.contentSize.height + 10
|
||||
|
||||
if !isBtnClick{
|
||||
self.headerData = self.karaokeListData.first
|
||||
@@ -154,6 +154,7 @@ class KaraokeListingVM{
|
||||
// if not multiple of 10, means more data can be there, show more btn
|
||||
self.vc.loadMoreBtn.isHidden = false
|
||||
}else{
|
||||
self.stopFetch = true
|
||||
self.vc.loadMoreBtn.isHidden = true
|
||||
}
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user