updated or release
This commit is contained in:
@@ -76,13 +76,8 @@ class ThemeOneVC: UIViewController {
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
vm.vc = self
|
||||
vm.initView()
|
||||
|
||||
if MyListDataTemp.shareInstance.favListingData?.showData == nil {
|
||||
MyListDataTemp.shareInstance.favListingData = FavouriteListingDM.ResultData(totalRecords: nil, showData: FavouriteListingDM.ResultData.ShowData(hindi: [],english: []),videoData: [],gameData: [],singKaraokeData: [],audioData: [])
|
||||
}
|
||||
vm.initView()
|
||||
vm.setupAvPlayer()
|
||||
|
||||
}
|
||||
|
||||
override func viewWillAppear(_ animated: Bool) {
|
||||
|
||||
@@ -50,6 +50,11 @@ class ThemeOneVM{
|
||||
}
|
||||
|
||||
func initView(){
|
||||
// Make sure to initialize a blank listing
|
||||
if MyListDataTemp.shareInstance.favListingData?.showData == nil {
|
||||
MyListDataTemp.shareInstance.favListingData = FavouriteListingDM.ResultData(totalRecords: nil, showData: FavouriteListingDM.ResultData.ShowData(hindi: [],english: []),videoData: [],gameData: [],singKaraokeData: [],audioData: [])
|
||||
}
|
||||
|
||||
// Update user Data on UI
|
||||
setUserData()
|
||||
|
||||
@@ -62,7 +67,6 @@ class ThemeOneVM{
|
||||
// start the time for moitoring time change.
|
||||
startInitialTimer()
|
||||
|
||||
// moveCloudView()
|
||||
//Handle tap gesutres
|
||||
handleTaps()
|
||||
|
||||
@@ -72,6 +76,7 @@ class ThemeOneVM{
|
||||
//add tap gesutre to the moving live tv
|
||||
addTapGestureToMovingView()
|
||||
|
||||
// to fit the hello and name in center properly without space
|
||||
vc.nameLabel.setContentHuggingPriority(.fittingSizeLevel, for: .horizontal)
|
||||
vc.nameLabel.setContentCompressionResistancePriority(.fittingSizeLevel, for: .horizontal)
|
||||
|
||||
@@ -91,8 +96,15 @@ class ThemeOneVM{
|
||||
if let adsData = AuthFunc.shareInstance.adsData{
|
||||
// check if ads data contains ad for webseries
|
||||
if let themeOneAd = adsData.result?.filter({$0.slug == AdsEnum.themeOne.rawValue}).first, let bannerImage = themeOneAd.advertisement?.bannerImage{
|
||||
vc.adBanner.imageURL(bannerImage, color: .textDarkBlue)
|
||||
vc.adBanner.isHidden = false
|
||||
vc.adBanner.imageURL(bannerImage, color: .textDarkBlue,type: .ads) { [weak self] isDone in
|
||||
guard let self else{return}
|
||||
// if image gives error hide the ad banner
|
||||
if isDone == false{
|
||||
vc.adBanner.isHidden = true
|
||||
}else{
|
||||
vc.adBanner.isHidden = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -542,23 +554,6 @@ class ThemeOneVM{
|
||||
.title(title)
|
||||
.build()
|
||||
|
||||
// Create a JWPlayerConfiguration.
|
||||
// if let adsData = AuthFunc.shareInstance.adsData, let liveTVAd = adsData.result?.filter({$0.slug == AdsEnum.liveTvAd.rawValue}).first, liveTVAd.googleAd != nil, let adConfig = JWAdsBuilder.shareInstace.createAds(adsData: [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: .preroll())]){
|
||||
// let config = try JWPlayerConfigurationBuilder()
|
||||
// .playlist(items: [item])
|
||||
// .autostart(true)
|
||||
// .advertising(adConfig)
|
||||
// .build()
|
||||
//
|
||||
// vc.config = config
|
||||
// }else{
|
||||
// let config = try JWPlayerConfigurationBuilder()
|
||||
// .playlist(items: [item])
|
||||
// .autostart(true)
|
||||
// .build()
|
||||
//
|
||||
// vc.config = config
|
||||
// }
|
||||
let config = try JWPlayerConfigurationBuilder()
|
||||
.playlist(items: [item])
|
||||
.autostart(true)
|
||||
|
||||
@@ -39,42 +39,85 @@ class UserNotificationVM{
|
||||
|
||||
// check if ads data contains LocalAD for webseries
|
||||
if let advertisement = notificatonAd.advertisement,let bannerImage = advertisement.bannerImage{
|
||||
let height = UIScreen.main.bounds.width * 0.192
|
||||
vc.adViewHeight.constant = height
|
||||
vc.adView.alpha = 0
|
||||
let imageView = UIImageView()
|
||||
|
||||
// Set the image you want to display
|
||||
imageView.imageURL(bannerImage, color: .white)
|
||||
|
||||
// Enable auto-layout
|
||||
imageView.translatesAutoresizingMaskIntoConstraints = false
|
||||
|
||||
// Add the UIImageView to the view
|
||||
vc.adView.addSubview(imageView)
|
||||
|
||||
// Set UIImageView to match the size of the parent UIView
|
||||
NSLayoutConstraint.activate([
|
||||
imageView.leadingAnchor.constraint(equalTo: vc.adView.leadingAnchor),
|
||||
imageView.trailingAnchor.constraint(equalTo: vc.adView.trailingAnchor),
|
||||
imageView.topAnchor.constraint(equalTo: vc.adView.topAnchor),
|
||||
imageView.bottomAnchor.constraint(equalTo: vc.adView.bottomAnchor)
|
||||
])
|
||||
imageView.contentMode = .scaleAspectFit
|
||||
UIView.animate(withDuration: 0.2, animations: { [weak self] in
|
||||
imageView.imageURL(bannerImage, color: .textDarkBlue,type: .ads) { [weak self] isDone in
|
||||
guard let self else{return}
|
||||
vc.adView.alpha = 1
|
||||
vc.adView.isHidden = false
|
||||
})
|
||||
|
||||
vc.adView.addTapGesture {
|
||||
if let adID = notificatonAd.id{
|
||||
PersistentStorage.shared.addAdsCount(adID: adID ,clicks: 1)
|
||||
}
|
||||
if let adLink = notificatonAd.advertisement?.adLink ,let url = URL(string: adLink), UIApplication.shared.canOpenURL(url) {
|
||||
UIApplication.shared.open(url)
|
||||
// if image gives error hide the ad banner
|
||||
if isDone == false{
|
||||
vc.adView.isHidden = true
|
||||
}else{
|
||||
let height = UIScreen.main.bounds.width * 0.192
|
||||
vc.adViewHeight.constant = height
|
||||
// Set the image you want to display
|
||||
imageView.imageURL(bannerImage, color: .white)
|
||||
|
||||
// Enable auto-layout
|
||||
imageView.translatesAutoresizingMaskIntoConstraints = false
|
||||
|
||||
// Add the UIImageView to the view
|
||||
vc.adView.addSubview(imageView)
|
||||
|
||||
// Set UIImageView to match the size of the parent UIView
|
||||
NSLayoutConstraint.activate([
|
||||
imageView.leadingAnchor.constraint(equalTo: vc.adView.leadingAnchor),
|
||||
imageView.trailingAnchor.constraint(equalTo: vc.adView.trailingAnchor),
|
||||
imageView.topAnchor.constraint(equalTo: vc.adView.topAnchor),
|
||||
imageView.bottomAnchor.constraint(equalTo: vc.adView.bottomAnchor)
|
||||
])
|
||||
imageView.contentMode = .scaleAspectFit
|
||||
UIView.animate(withDuration: 0.2, animations: { [weak self] in
|
||||
guard let self else{return}
|
||||
vc.adView.alpha = 1
|
||||
})
|
||||
|
||||
vc.adView.addTapGesture {
|
||||
if let adID = notificatonAd.id{
|
||||
PersistentStorage.shared.addAdsCount(adID: adID ,clicks: 1)
|
||||
}
|
||||
if let adLink = notificatonAd.advertisement?.adLink ,let url = URL(string: adLink), UIApplication.shared.canOpenURL(url) {
|
||||
UIApplication.shared.open(url)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//
|
||||
// let height = UIScreen.main.bounds.width * 0.192
|
||||
// vc.adViewHeight.constant = height
|
||||
// vc.adView.alpha = 0
|
||||
// let imageView = UIImageView()
|
||||
//
|
||||
// // Set the image you want to display
|
||||
// imageView.imageURL(bannerImage, color: .white)
|
||||
//
|
||||
// // Enable auto-layout
|
||||
// imageView.translatesAutoresizingMaskIntoConstraints = false
|
||||
//
|
||||
// // Add the UIImageView to the view
|
||||
// vc.adView.addSubview(imageView)
|
||||
//
|
||||
// // Set UIImageView to match the size of the parent UIView
|
||||
// NSLayoutConstraint.activate([
|
||||
// imageView.leadingAnchor.constraint(equalTo: vc.adView.leadingAnchor),
|
||||
// imageView.trailingAnchor.constraint(equalTo: vc.adView.trailingAnchor),
|
||||
// imageView.topAnchor.constraint(equalTo: vc.adView.topAnchor),
|
||||
// imageView.bottomAnchor.constraint(equalTo: vc.adView.bottomAnchor)
|
||||
// ])
|
||||
// imageView.contentMode = .scaleAspectFit
|
||||
// UIView.animate(withDuration: 0.2, animations: { [weak self] in
|
||||
// guard let self else{return}
|
||||
// vc.adView.alpha = 1
|
||||
// vc.adView.isHidden = false
|
||||
// })
|
||||
//
|
||||
// vc.adView.addTapGesture {
|
||||
// if let adID = notificatonAd.id{
|
||||
// PersistentStorage.shared.addAdsCount(adID: adID ,clicks: 1)
|
||||
// }
|
||||
// if let adLink = notificatonAd.advertisement?.adLink ,let url = URL(string: adLink), UIApplication.shared.canOpenURL(url) {
|
||||
// UIApplication.shared.open(url)
|
||||
// }
|
||||
// }
|
||||
}else if notificatonAd.googleAd != nil{
|
||||
/*
|
||||
Show google ads with dispatch queue.
|
||||
|
||||
Reference in New Issue
Block a user