final commit

This commit is contained in:
Bilal
2024-10-18 21:04:58 +05:30
parent c8e417b98d
commit 178f3fe2a0
28 changed files with 117 additions and 119 deletions

View File

@@ -1,5 +1,5 @@
# Uncomment the next line to define a global platform for your project
platform :ios, '13.0'
platform :ios, '14.0'
target 'WOKA' do
# Comment the next line if you don't want to use dynamic frameworks
@@ -20,7 +20,7 @@ target 'WOKA' do
pod 'Google-Mobile-Ads-SDK'
#JwPlayer
# pod 'JWPlayerKit'
pod 'JWPlayerKit' , '~> 4.19.2'
# Bottom line is for removing IPHONEOS_DEPLOYMENT_TARGET
post_install do |installer|

View File

@@ -54,7 +54,6 @@
5255C3FF2C5B67E70030BB22 /* WokaFMVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5255C3FE2C5B67E70030BB22 /* WokaFMVC.swift */; };
5257B2652BDFB6F50086D79B /* CheckPhoneHomeBtnOrNotch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5257B2642BDFB6F50086D79B /* CheckPhoneHomeBtnOrNotch.swift */; };
5258464F2C491829004F074B /* connectedness.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5258464E2C491829004F074B /* connectedness.swift */; };
525855152CBCECC300E6002A /* JWPlayerKit in Frameworks */ = {isa = PBXBuildFile; productRef = 525855142CBCECC300E6002A /* JWPlayerKit */; };
525855172CBD3C7100E6002A /* PlayerStatusEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525855162CBD3C6C00E6002A /* PlayerStatusEnum.swift */; };
525861D02C4F9E3200C33C79 /* SwipeTableViewFont.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525861CF2C4F9E3200C33C79 /* SwipeTableViewFont.swift */; };
525861D22C4FC6C000C33C79 /* CartPaymentOptionsVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 525861D12C4FC6C000C33C79 /* CartPaymentOptionsVC.swift */; };
@@ -115,7 +114,6 @@
527AC6FD2C173A5100434FB7 /* SongListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 527AC6FB2C173A5100434FB7 /* SongListCell.swift */; };
527AC6FE2C173A5100434FB7 /* SongListCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 527AC6FC2C173A5100434FB7 /* SongListCell.xib */; };
527AC7012C182DCE00434FB7 /* TimeStringToSeconds.swift in Sources */ = {isa = PBXBuildFile; fileRef = 527AC7002C182DCE00434FB7 /* TimeStringToSeconds.swift */; };
5282DB292C92D73B00465BA1 /* GoogleInteractiveMediaAds in Frameworks */ = {isa = PBXBuildFile; productRef = 5282DB282C92D73B00465BA1 /* GoogleInteractiveMediaAds */; };
5282DB2F2C981EAD00465BA1 /* AdReusable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5282DB2E2C981EAD00465BA1 /* AdReusable.swift */; };
528BEF602C2C372900FFDAB8 /* ContinueWatchingVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 528BEF5F2C2C372900FFDAB8 /* ContinueWatchingVC.swift */; };
528E5F1B2C24531200E33E4E /* SeasonListingDM.swift in Sources */ = {isa = PBXBuildFile; fileRef = 528E5F1A2C24531200E33E4E /* SeasonListingDM.swift */; };
@@ -761,6 +759,7 @@
9CBE1B3C2C0F37B200CA6E61 /* DropDown.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DropDown.h; sourceTree = "<group>"; };
9CC0D2F92C6F33BE0019DF73 /* AuthFuncUserVideoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthFuncUserVideoView.swift; sourceTree = "<group>"; };
9CC0D2FB2C6F5CAE0019DF73 /* PlayerVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerVM.swift; sourceTree = "<group>"; };
9CC856602CC2B6BA00444C5B /* WOKA.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = WOKA.xcodeproj; sourceTree = "<group>"; };
9CDAEB022C53B97B00890C47 /* VersionTexts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VersionTexts.swift; sourceTree = "<group>"; };
9CDAEB042C53DB2900890C47 /* ProductDetailsVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductDetailsVC.swift; sourceTree = "<group>"; };
9CDAEB062C53E42900890C47 /* ProductDetailsVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductDetailsVM.swift; sourceTree = "<group>"; };
@@ -788,14 +787,12 @@
4469E533EC95AC428FE50FB2 /* Pods_WOKA.framework in Frameworks */,
52C83E3F2C493FD700F27563 /* RSKPlaceholderTextView in Frameworks */,
9CF6980B2C89A324006007EF /* Lottie in Frameworks */,
525855152CBCECC300E6002A /* JWPlayerKit in Frameworks */,
9CBA530C2C89A2680046735C /* FirebaseAnalytics in Frameworks */,
9CF6980F2C8AFFBF006007EF /* SDWebImage in Frameworks */,
9CBA530E2C89A2680046735C /* FirebaseCrashlytics in Frameworks */,
528F26F02C6B7BD1003E4D99 /* OneSignalFramework in Frameworks */,
528F26F22C6B7BD1003E4D99 /* OneSignalInAppMessages in Frameworks */,
9CBA53102C89A2680046735C /* FirebasePerformance in Frameworks */,
5282DB292C92D73B00465BA1 /* GoogleInteractiveMediaAds in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -940,6 +937,7 @@
523ED2512BDA2BC700CFED02 = {
isa = PBXGroup;
children = (
9CC856602CC2B6BA00444C5B /* WOKA.xcodeproj */,
523ED25C2BDA2BC700CFED02 /* WOKA */,
523ED2732BDA2BC900CFED02 /* WOKATests */,
523ED27D2BDA2BC900CFED02 /* WOKAUITests */,
@@ -2090,8 +2088,6 @@
9CBA530F2C89A2680046735C /* FirebasePerformance */,
9CF6980A2C89A324006007EF /* Lottie */,
9CF6980E2C8AFFBF006007EF /* SDWebImage */,
5282DB282C92D73B00465BA1 /* GoogleInteractiveMediaAds */,
525855142CBCECC300E6002A /* JWPlayerKit */,
);
productName = WOKA;
productReference = 523ED25A2BDA2BC700CFED02 /* WOKA.app */;
@@ -2195,8 +2191,6 @@
9CBA530A2C89A2680046735C /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
9CF698092C89A324006007EF /* XCRemoteSwiftPackageReference "lottie-spm" */,
9CF6980D2C8AFFBF006007EF /* XCRemoteSwiftPackageReference "SDWebImage" */,
5282DB272C92D73B00465BA1 /* XCRemoteSwiftPackageReference "swift-package-manager-google-interactive-media-ads-ios" */,
525855132CBCECC300E6002A /* XCRemoteSwiftPackageReference "JWPlayerKit-package" */,
);
productRefGroup = 523ED25B2BDA2BC700CFED02 /* Products */;
projectDirPath = "";
@@ -2909,8 +2903,8 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = WOKA/WOKA.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 8;
DEBUG_INFORMATION_FORMAT = dwarf;
CURRENT_PROJECT_VERSION = 10;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 4S9A74ZB6H;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
@@ -2953,7 +2947,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = WOKA/WOKA.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 8;
CURRENT_PROJECT_VERSION = 10;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 4S9A74ZB6H;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
@@ -3182,22 +3176,6 @@
/* End XCConfigurationList section */
/* Begin XCRemoteSwiftPackageReference section */
525855132CBCECC300E6002A /* XCRemoteSwiftPackageReference "JWPlayerKit-package" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/jwplayer/JWPlayerKit-package.git";
requirement = {
kind = exactVersion;
version = 4.19.1;
};
};
5282DB272C92D73B00465BA1 /* XCRemoteSwiftPackageReference "swift-package-manager-google-interactive-media-ads-ios" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/googleads/swift-package-manager-google-interactive-media-ads-ios";
requirement = {
branch = main;
kind = branch;
};
};
528F26EC2C6B7BD1003E4D99 /* XCRemoteSwiftPackageReference "OneSignal-XCFramework" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/OneSignal/OneSignal-XCFramework";
@@ -3241,16 +3219,6 @@
/* End XCRemoteSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
525855142CBCECC300E6002A /* JWPlayerKit */ = {
isa = XCSwiftPackageProductDependency;
package = 525855132CBCECC300E6002A /* XCRemoteSwiftPackageReference "JWPlayerKit-package" */;
productName = JWPlayerKit;
};
5282DB282C92D73B00465BA1 /* GoogleInteractiveMediaAds */ = {
isa = XCSwiftPackageProductDependency;
package = 5282DB272C92D73B00465BA1 /* XCRemoteSwiftPackageReference "swift-package-manager-google-interactive-media-ads-ios" */;
productName = GoogleInteractiveMediaAds;
};
528F26ED2C6B7BD1003E4D99 /* OneSignalExtension */ = {
isa = XCSwiftPackageProductDependency;
package = 528F26EC2C6B7BD1003E4D99 /* XCRemoteSwiftPackageReference "OneSignal-XCFramework" */;

View File

@@ -55,7 +55,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"

View File

@@ -74,6 +74,7 @@ class AudioBookDetailsVC : UIViewController{
if let postID = audioData?.id{
PersistentStorage.shared.addAudioCount(postID: postID)
}
HapticFeedbackGenerator.shared.simpleSelection()
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
if let audioData{
@@ -145,6 +146,7 @@ class AudioBookDetailsVC : UIViewController{
if let postID = audioData?.id{
PersistentStorage.shared.addAudioCount(postID: postID)
}
HapticFeedbackGenerator.shared.simpleSelection()
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
if let audioData{
@@ -222,6 +224,7 @@ class AudioBookDetailsVC : UIViewController{
}
shareView.addTapGesture { [weak self] in
HapticFeedbackGenerator.shared.simpleSelection()
guard let self else{return}
if let postID = audioData?.id{
PersistentStorage.shared.addAudioCount(postID: postID)

View File

@@ -211,6 +211,7 @@ extension AudioBookHomeVC : TableViewSRC{
cell.btnTapped = { [weak self] (type) -> Void in
guard let self else{return}
HapticFeedbackGenerator.shared.simpleSelection()
let data = vm.audioListData[indexPath.row]
guard let postID = data.id ,let postType = data.contentMoreDetails?.first?.postType else{return}
let isFav = data.markAsFavourite
@@ -266,6 +267,7 @@ extension AudioBookHomeVC : CollectionViewSRC{
cell.setAudioData(data: data)
cell.btnTapped = { [self] (type) -> Void in
HapticFeedbackGenerator.shared.simpleSelection()
guard let postID = data.id ,let postType = data.contentMoreDetails?.first?.postType else{return}
let isFav = data.markAsFavourite
let isLiked = data.isLiked

View File

@@ -46,4 +46,9 @@ extension K{
}
struct MediaIDs{
// this will map the live stream data
static let liveStreamMediaID = "YR5pnlIM"
}
}

View File

@@ -124,6 +124,7 @@ class GamesDetailVC: UIViewController {
addView.addTapGesture { [weak self] in
guard let self else{return}
HapticFeedbackGenerator.shared.simpleSelection()
if let postID = gameData?.id{
PersistentStorage.shared.addGamesCount(postID: postID)
}
@@ -173,6 +174,7 @@ class GamesDetailVC: UIViewController {
likeView.addTapGesture { [weak self] in
guard let self else{return}
HapticFeedbackGenerator.shared.simpleSelection()
if let postID = gameData?.id{
PersistentStorage.shared.addGamesCount(postID: postID)
}
@@ -213,6 +215,7 @@ class GamesDetailVC: UIViewController {
shareView.addTapGesture { [weak self] in
guard let self else{return}
HapticFeedbackGenerator.shared.simpleSelection()
if let postID = gameData?.id{
PersistentStorage.shared.addGamesCount(postID: postID)
}

View File

@@ -159,6 +159,7 @@ extension GamesListVC : TableViewSRC{
}
cell.btnTapped = { [self] (type) -> Void in
HapticFeedbackGenerator.shared.simpleSelection()
vm.updateFavLikes(type: type, index: indexPath.row)
}

View File

@@ -813,6 +813,7 @@ extension MyListVC : GADBannerViewDelegate{
func bannerViewDidReceiveAd(_ bannerView: GADBannerView) {
adView.alpha = 0
adView.isHidden = false
adHeight.constant = 90
UIView.animate(withDuration: 0.2, animations: { [weak self] in
self?.adView.alpha = 1
})

View File

@@ -107,7 +107,6 @@ class MyListVM{
}else if myListAd.googleAd != nil{
//setup google banner ads.
vc.adHeight.constant = 90
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3, execute: {
AdReusable.sharedInstance.setupBannerAd(bannerView: self.bottomBanner, in: self.vc.adView, adUnitID: K.GoogleAdIDs.myListNotifications, viewController: self.vc, height: 6,width: 0)
})

View File

@@ -54,13 +54,13 @@ class JWKaraokePlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate
playerView.allowsPictureInPicturePlayback = false
playerView.captionStyle = .none
let skinStylingBuilder = JWPlayerSkinBuilder()
.adCueColor(.yellow)
// .buttonsColor(.blue)
// .backgroundColor(.cyan)
let skinStyling = try? skinStylingBuilder.build()
self.styling = skinStyling
// let skinStylingBuilder = JWPlayerSkinBuilder()
// .adCueColor(.yellow)
// // .buttonsColor(.blue)
// // .backgroundColor(.cyan)
//
// let skinStyling = try? skinStylingBuilder.build()
// self.styling = skinStyling
self.setVisibility(.hidden, for: [.fullscreenButton, .pictureInPictureButton, .settingsButton,.languagesButton, .airplayButton])
self.view.bringSubviewToFront(outerStack)
@@ -113,9 +113,11 @@ class JWKaraokePlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate
}
@IBAction func playBtnTapped(_ sender: LocalisedElementsButton) {
// update the clicks.
if let postID = vm.postID{
PersistentStorage.shared.addKaraokeCount(postID: postID)
}
if !isPlaying {
vm.playMixedAudio()
sender.setTitle("Pause", for: .normal)
@@ -127,9 +129,9 @@ class JWKaraokePlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate
self.startRecordBtn.isEnabled = false
self.downloadRecordingBtn.isEnabled = false
} else {
vm.playerKAraoke.pause()
sender.setTitle("Play", for: .normal)
sender.setImage(UIImage(named: "PlayButtonSmall"), for: .normal)
// Disable Recording while playing, hide controls for jwplayer
self.interfaceBehavior = .normal
self.startRecordBtn.isEnabled = true

View File

@@ -132,6 +132,7 @@ class KaraokeDetailsVC: UIViewController {
func tapHandler(){
addView.addTapGesture { [weak self] in
HapticFeedbackGenerator.shared.simpleSelection()
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
guard let self else{return}
@@ -173,6 +174,7 @@ class KaraokeDetailsVC: UIViewController {
}
likeView.addTapGesture { [weak self] in
HapticFeedbackGenerator.shared.simpleSelection()
if AuthFunc.shareInstance.guestUserLoginPopUp() { return}
guard let self else{return}

View File

@@ -164,6 +164,7 @@ extension KaraokeListingVC : CollectionViewSRC{
cell.setKaraokeData(data: data)
cell.btnTapped = { [self] (type) -> Void in
HapticFeedbackGenerator.shared.simpleSelection()
guard let postID = data.id ,let postType = data.contentMoreDetails?.first?.postType else{return}
let isFav = data.markAsFavourite
let isLiked = data.isLiked
@@ -249,6 +250,7 @@ extension KaraokeListingVC : TableViewSRC{
cell.btnTapped = { [weak self] (type) -> Void in
guard let self else{return}
HapticFeedbackGenerator.shared.simpleSelection()
let data = vm.karaokeListData[indexPath.row]
guard let postID = data.id ,let postType = data.contentMoreDetails?.first?.postType else{return}
let isFav = data.markAsFavourite

View File

@@ -30,6 +30,8 @@ class JWKaraokePlayerVM{
var startTimeStamp = Date()
var headerBannerView = GADBannerView()
var playerKAraoke = AVPlayer()
func initView(){
if let adsData = AuthFunc.shareInstance.adsData, let karaokePlayerAd = adsData.result?.filter({$0.slug == AdsEnum.karaokePlayer.rawValue}).first, karaokePlayerAd.googleAd != nil{
/*
@@ -188,27 +190,13 @@ class JWKaraokePlayerVM{
try FileManager.default.copyItem(at: mixedAudioURL, to: destinationURL)
// Play the audio
let playerKAraoke = AVPlayer(url: destinationURL)
playerKAraoke = AVPlayer(url: destinationURL)
// Adding a completion handler to check if the player starts playing
let playerObserver = playerKAraoke.addPeriodicTimeObserver(forInterval: CMTime(seconds: 1, preferredTimescale: 1), queue: .main) { time in
print("Playing audio at time: \(time.seconds)")
}
// Observing when playback finishes
NotificationCenter.default.addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: playerKAraoke.currentItem, queue: .main) { [weak self] _ in
print("Audio finished playing")
guard let self else{return}
self.vc.playBtn.setTitle("Play", for: .normal)
self.vc.playBtn.setImage(UIImage(named: "PlayButtonSmall"), for: .normal)
// Disable Recording while playing, hide controls for jwplayer
self.vc.interfaceBehavior = .normal
self.vc.startRecordBtn.isEnabled = true
self.vc.downloadRecordingBtn.isEnabled = true
// Remove observer
playerKAraoke.removeTimeObserver(playerObserver)
}
playerKAraoke.volume = 1.0
playerKAraoke.play()
@@ -225,6 +213,21 @@ class JWKaraokePlayerVM{
audioPlayer.play()
*/
// Observing when playback finishes
NotificationCenter.default.addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: playerKAraoke.currentItem, queue: .main) { [weak self] _ in
print("Audio finished playing")
guard let self else{return}
self.vc.playBtn.setTitle("Play", for: .normal)
self.vc.playBtn.setImage(UIImage(named: "PlayButtonSmall"), for: .normal)
// Disable Recording while playing, hide controls for jwplayer
self.vc.interfaceBehavior = .normal
self.vc.startRecordBtn.isEnabled = true
self.vc.downloadRecordingBtn.isEnabled = true
// Remove observer
playerKAraoke.removeTimeObserver(playerObserver)
self.vc.isPlaying = false
}
} catch {
print("Error: \(error.localizedDescription)")
}

View File

@@ -11,6 +11,7 @@ import Alamofire
extension AuthFunc{
func userVideoView(postID : Int, postType : Int, duration : Int, catID : Int, onCompletion : @escaping (Bool) -> Void){
print("UserVideo View called.")
let headers : HTTPHeaders = ["access-token" : AuthFunc.shareInstance.getAccessToken(),
"device-id": AuthFunc.shareInstance.getDeviceUUID()]
let params : Parameters = ["post_id" : postID,

View File

@@ -55,17 +55,9 @@ class JWPlayerManager {
continue
}
// let source = try JWVideoSourceBuilder()
// .defaultVideo(true)
// .file(url)
// .label("0")
// .build()
let item = try JWPlayerItemBuilder()
.file(url)
// .videoSources([source])
.title(singleItem.titles ?? "")
.title(singleItem.titles ?? "NA")
.posterImage(URL(string: singleItem.poster ?? "")!)
.build()
@@ -114,16 +106,12 @@ class JWPlayerManager {
// Create an ad break for 30% into the video
let finalConfig : JWPlayerConfiguration?
//
// let ad1 = AdBreakItemStruct(adUrl: URL(string: "https://pubads.g.doubleclick.net/gampad/ads?iu=/23204950200/VideoAd&description_url=https%3A%2F%2Fwokaland.com%2F&tfcd=0&npa=0&ad_type=audio_video&sz=640x480%7C1280x720&gdfp_req=1&unviewed_position_start=1&output=vast&env=vp&impl=s&correlator=")!, offset: .midroll(percent: 40))
// let ad2 = AdBreakItemStruct(adUrl: URL(string: "https://pubads.g.doubleclick.net/gampad/live/ads?iu=/23204950200/VideoAd&description_url=https%3A%2F%2Fwokaland.com%2F&tfcd=0&npa=0&ad_type=audio_video&sz=640x480%7C1280x720&gdfp_req=1&unviewed_position_start=1&output=vast&env=vp&impl=s&correlator=&nofb=1")!, offset: .midroll(percent: 80))
// let ad3 = AdBreakItemStruct(adUrl: URL(string: "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_preroll_skippable&sz=640x480&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=90")!, offset: .midroll(percent: 90))
switch contentType{
case .audioBooks:
finalConfig = try JWPlayerConfigurationBuilder()
.playlist(items: items)
.autostart(true)
.autostart(false)
.build()
// if let adConfigs = JWAdsBuilder.shareInstace.createAds(adsData: [ad1,ad2,ad3]){
// finalConfig = try JWPlayerConfigurationBuilder()
@@ -173,7 +161,7 @@ class JWPlayerManager {
.build()
}
DispatchQueue.main.async {
// DispatchQueue.main.async {
playerVC.videoIndex = startIndex
playerVC.contentType = contentType
playerVC.config = finalConfig
@@ -192,7 +180,7 @@ class JWPlayerManager {
// print("FullScreen")
// }
}
}
// }
} catch {
print("Error creating JWPlayer configuration: \(error)")
Utilities.dismissProgressHUD()

View File

@@ -37,7 +37,7 @@ struct APIEndPoints {
static let development = "https://wokanative.betadelivery.com/api/"
static let staging = "https://wokastaging.in/api/"
static let production = "https://wokaland.com/secret-panel-10102023/hidden-admin-portal-20092023/api/"
static let baseUrlForCurrentEvn = makeURL(path: "")
static let appUrl = "https://apps.apple.com/in/app/woka/id6465305185"
}

View File

@@ -95,11 +95,6 @@ class NetworkManager{
vcPush.modalPresentationStyle = .overCurrentContext
vcPush.modalTransitionStyle = .crossDissolve
topController.present(vcPush, animated: true)
// Utilities.alertWithBtnCompletion(title: "Session Expired", msgBody: "Please Login Again", okBtnStr: "OK", vc: topController) { isDone in
// AuthFunc.shareInstance.logout()
// UIApplication.setRootView(LoginNavVC.instantiate(from: .AuthenticationSB))
// }
}
return
}

View File

@@ -53,6 +53,18 @@ class SplashVC: UIViewController {
vm.playSplashSound()
animateImageScale()
// toast if the server is staging or development.
switch String(describing:APIEndPoints.BaseURL.baseUrlForCurrentEvn){
case APIEndPoints.BaseURL.development:
toast(msg: "Server is runnning on Development", time: 1)
case APIEndPoints.BaseURL.staging:
toast(msg: "Server is runnning on Staging", time: 1)
case APIEndPoints.BaseURL.production:
print("Server is running on production")
default:
break
}
}
@IBAction func languageBtnTapped(_ sender: UIButton) {

View File

@@ -145,7 +145,6 @@ class SplashVM{
func getVersionHistory(){
let currentAppVersion = Bundle.main.appVersionLong
/*
If user is guest then dont do the nw call
*/

View File

@@ -9,7 +9,7 @@ import UIKit
import JWPlayerKit
import AVKit
class PlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate {
class PlayerVC: JWPlayerViewController, JWPlayerViewControllerUIDelegate, JWPlayerViewControllerRelatedDelegate { //JWPlayerViewControllerFullScreenDelegate
@IBOutlet weak var backButton: UIButton!
var previousScale: CGFloat = 1.0
@@ -48,11 +48,10 @@ class PlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate {
return true
}
}
override func viewDidLoad() {
super.viewDidLoad()
self.delegate = self
player.configurePlayer(with: config)
self.setVisibility(.hidden, for: [.fullscreenButton, .pictureInPictureButton,.languagesButton, .chromecastButton, .exitFullScreenButton])
vm.vc = self
vm.initView()
//bring back button to the front
@@ -60,17 +59,18 @@ class PlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate {
NotificationCenter.default.addObserver(self, selector: #selector(appDidEnterBackground), name: UIApplication.didEnterBackgroundNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(appWillEnterForeground), name: UIApplication.willEnterForegroundNotification, object: nil)
let skinStylingBuilder = JWPlayerSkinBuilder()
.adCueColor(.yellow)
// .buttonsColor(.blue)
// .backgroundColor(.cyan)
// self.fullScreenDelegate = self
self.uiDelegate = self
self.relatedDelegate = self
self.player.configurePlayer(with: self.config)
// let skinStylingBuilder = JWPlayerSkinBuilder()
// .adCueColor(.yellow)
// // .buttonsColor(.blue)
// // .backgroundColor(.cyan)
//
// let skinStyling = try? skinStylingBuilder.build()
// self.styling = skinStyling
let skinStyling = try? skinStylingBuilder.build()
self.styling = skinStyling
self.setVisibility(.hidden, for: [.fullscreenButton, .pictureInPictureButton,.languagesButton])
print("Quality:- ", player.visualQualityLevels)
}
override func viewDidAppear(_ animated: Bool) {
@@ -143,7 +143,7 @@ class PlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate {
case .trailer:
let duration = DateFormatterLib.dateDifferenceINT(date1: vm.startTimeStamp, date2: Date())
let totalDuration = duration + vm.totalVideoViewTime
AuthFunc.shareInstance.userVideoView(postID: 0, postType: PostType.episode.rawValue, duration: totalDuration, catID: 0) { _ in}
AuthFunc.shareInstance.userVideoView(postID: 0, postType: PostType.teaser.rawValue, duration: totalDuration, catID: 0) { _ in}
vm.handleBackAction()
case .continueWatching:
if let catID = vm.catID,let postID = vm.videoIDs.first{
@@ -250,10 +250,10 @@ class PlayerVC: JWPlayerViewController, JWPlayerViewControllerDelegate {
print("PlayList Over", vm.currentPlayingIndex)
}
override func jwplayer(_ player: any JWPlayer, didLoadPlaylist playlist: [JWPlayerItem]) {
super.jwplayer(player, didLoadPlaylist: playlist)
print("Playlist loaded")
}
// override func jwplayer(_ player: any JWPlayer, didLoadPlaylist playlist: [JWPlayerItem]) {
// super.jwplayer(player, didLoadPlaylist: playlist)
// print("Playlist loaded")
// }
// this will give index
override func jwplayer(_ player: any JWPlayer, didLoadPlaylistItem item: JWPlayerItem, at index: UInt) {

View File

@@ -93,7 +93,7 @@ class ThemeOneVC: UIViewController {
override func viewDidAppear(_ animated: Bool) {
// OFF In Production
AuthFunc.shareInstance.getAds()
// AuthFunc.shareInstance.getAds()
K.GVar.topView = .theme1

View File

@@ -71,7 +71,7 @@ class PlayerVM{
case .trailer:
let duration = DateFormatterLib.dateDifferenceINT(date1: startTimeStamp, date2: Date())
let totalDuration = duration + totalVideoViewTime
AuthFunc.shareInstance.userVideoView(postID: 0, postType: PostType.episode.rawValue, duration: totalDuration, catID: 0) { _ in}
AuthFunc.shareInstance.userVideoView(postID: 0, postType: PostType.teaser.rawValue, duration: totalDuration, catID: 0) { _ in}
case .continueWatching:
if let catID = catID , let postID = videoIDs.first{
let duration = DateFormatterLib.dateDifferenceINT(date1: startTimeStamp, date2: Date())

View File

@@ -416,7 +416,10 @@ class ThemeOneVM{
// title = liveStreamData.name?.titleHin ?? ""
}
guard let streamURL = URL(string: url) else{return}
guard url != "",let streamURL = URL(string: url) else{
print("Live strean URL is null")
return
}
playerItem = AVPlayerItem(url: streamURL)
@@ -568,6 +571,7 @@ class ThemeOneVM{
let item = try JWPlayerItemBuilder()
.videoSources([videoSourceBuilder])
.title(title)
.mediaId(K.MediaIDs.liveStreamMediaID)
.build()
let config = try JWPlayerConfigurationBuilder()

View File

@@ -199,6 +199,7 @@ class ThemeTwoVM{
// .file(liveStreamURL)
.videoSources([videoSourceBuilder])
.title(title)
.mediaId(K.MediaIDs.liveStreamMediaID)
.build()
// Create a JWPlayerConfiguration

View File

@@ -209,16 +209,19 @@ extension WebSeriesSeasonVC : TableViewSRC{
var url = String()
guard let englishData = i.contentMoreDetails?.filter({$0.languageMasterID == 1}).first, let hindiData = i.contentMoreDetails?.filter({$0.languageMasterID == 2}).first else{return}
if let id = i.id{
videoIDs.append(id)
}
/*
Based on selected Category language update the url
*/
if vm.categoryID == 1{ //1- english , 18 - hindi
url = englishData.contentHDURL ?? ""
if let id = i.contentMoreDetails?.first?.id{
videoIDs.append(id)
}
}else{
url = hindiData.contentHDURL ?? ""
if let id = i.contentMoreDetails?.last?.id{
videoIDs.append(id)
}
}
/*
@@ -257,9 +260,9 @@ extension WebSeriesSeasonVC : TableViewSRC{
vcPush.teaserData = data
default:
let selectedMediaType = vm.seasonListingData.filter({$0.id == vm.episodeSelectedCateogory!}).first
print(selectedMediaType?.mediaType)
let data = vm.seasonEpisodeData[indexPath.row]
if let showID = data.id, let catID = self.vm.categoryID{
if let showID = data.id, let catID = self.vm.categoryID {
PersistentStorage.shared.addWebSeries(catID: catID, postID: showID, postType: .episode)
}
vcPush.episodeData = data
@@ -296,9 +299,6 @@ extension WebSeriesSeasonVC : TableViewSRC{
var videoIDs = [Int]()
for i in episodeData{
var url = String()
if let id = i.id{
videoIDs.append(id)
}
guard let englishData = i.contentMoreDetails?.filter({$0.languageMasterID == 1}).first, let hindiData = i.contentMoreDetails?.filter({$0.languageMasterID == 2}).first else{return}
/*
@@ -306,8 +306,14 @@ extension WebSeriesSeasonVC : TableViewSRC{
*/
if vm.categoryID == 1{ //1- english , 18 - hindi
url = englishData.contentHDURL ?? ""
if let id = i.contentMoreDetails?.first?.id{
videoIDs.append(id)
}
}else{
url = hindiData.contentHDURL ?? ""
if let id = i.contentMoreDetails?.last?.id{
videoIDs.append(id)
}
}
/*

View File

@@ -193,6 +193,7 @@ extension WebSeriesVC : TableViewSRC {
}
cell.btnTapped = { [self] (type) -> Void in
HapticFeedbackGenerator.shared.simpleSelection()
updateFavLikes(type: type, index: indexPath.row)
}

View File

@@ -50,7 +50,7 @@ class WebSeriesSeasonVM{
guard let self ,let indexSelected, let categoryID, let showData, let showID = showData.id, let isFav = showData.markAsFavourite, let postType = showData.contentMoreDetails?.first?.postType else{return}
PersistentStorage.shared.addWebSeries(catID: categoryID, postID: showID, postType: .series)
HapticFeedbackGenerator.shared.lightImpact()
HapticFeedbackGenerator.shared.simpleSelection()
if isFav {
//remove
LikeFavCommonFunc.shareInstance.removeFavourite(postID: showID, postType: postType, categoryID: categoryID, vc: self.vc) { isDone in
@@ -98,7 +98,7 @@ class WebSeriesSeasonVM{
guard let self ,let indexSelected, let showData, let showID = showData.id, let isLiked = showData.isLiked, let postType = showData.contentMoreDetails?.first?.postType else{return}
PersistentStorage.shared.addWebSeries(catID: self.categoryID ?? 0, postID: showID, postType: .series)
HapticFeedbackGenerator.shared.lightImpact()
HapticFeedbackGenerator.shared.simpleSelection()
if isLiked{
LikeFavCommonFunc.shareInstance.unlikePost(postID: showID, postType: postType, vc: self.vc) { isDone in
self.showData?.isLiked = false