Soru & Cevap

iOS MPMoviePlayerViewController loadState kontrolü ...

24.03.2015 - 05:07

Merhaba,
uygulamamda internet sitemden bir mp4 videoyu MPMoviePlayerViewController ile oynatıyorum. Bu esnada da buffer devam ediyorsa statusbar da networkActivityIndicatorVisible ayarını true olarak ayarlamak istiyorum. Eğer video  yüklemesi tamamlandıysa yani video oynama devam ediyor ama buffer bittiyse network alışverişi kalmadıysa da  networkActivityIndicatorVisible ayarını false yapmak istiyorum. Bunun için kullandığım kodlar şu şekilde. ancak bir türlü network veri aktarımı olup olmadığını kontrol edemiyorum.

[code]let moviePlayer: MPMoviePlayerViewController = MPMoviePlayerViewController(contentURL: movieURL)
NSNotificationCenter.defaultCenter().addObserver(self, selector: "videoIndicatorStateUpdate:", name: MPMoviePlayerLoadStateDidChangeNotification, object: nil)


func videoIndicatorStateUpdate(notification: NSNotification){
        var moviePlayerController = notification.object as MPMoviePlayerController
        var loadState: NSMutableString
        var state = moviePlayerController.loadState as MPMovieLoadState
        if (state == MPMovieLoadState.Stalled) { 
           UIApplication.sharedApplication().networkActivityIndicatorVisible = true
          println("Video buffering")
        }else{
            UIApplication.sharedApplication().networkActivityIndicatorVisible = false
        println("Video buffer end!")
        }
    }

[/code]

43 Görüntülenme

4 Cevap

Sitedeki sorulara cevap verebilmek için giriş yapın ya da üye olun.

Profile picture for user sheilacorvin298
sheilacorvin298
07.10.2022 - 06:43

It is helpful to enjoy the game with watching movies. But one question is that can I use normal laptop for gaming?

Profile picture for user sheilacorvin298
sheilacorvin298
06.09.2022 - 04:31

At the point when everything revolves around choosing the most magnificent site for purchasing the adherents, you should think about the validation of the site. As a truth, only one out of every odd site is solid or valid and that is the reason; you should think about every one of the elements and functionalities of the site. Assuming you are new to TikTok and you don't have a lot of thought regarding the stage, then you will need to guarantee that you go for the right sort of site that offer the choice of purchasing the supporters of TikTok. Must check JioSaavn Pro APK Download

Profile picture for user eonline
eonline
18.07.2022 - 03:26

Have you tried out HotStar Premium, it's the best streaming app for real

Profile picture for user mariaboyd
mariaboyd
10.05.2022 - 11:51

Film izlemeyi severim, bu yüzden telefonumdaki film izleme uygulamalarına bakarım. En sevdiğim uygulama netflix mod apk , film izlemek için harika.