ios - Hiding Video Controls MPMoviePlayerController - SWIFT -
ios - Hiding Video Controls MPMoviePlayerController - SWIFT -
i have referenced several responses same question solution not work me. wish hide user controls whilst watching video of local content. faults on line movieplayer?.controlstyle = mpmoviecontrolstylenone error "use of unresolved identifier mpmoviecontrolstylenone.
here total block of code.
import uikit import mediaplayer var movieplayer : mpmovieplayercontroller? class viewcontroller: uiviewcontroller { func playvideo() { allow path = nsbundle.mainbundle().pathforresource("introvideo", oftype: "mp4") allow url = nsurl.fileurlwithpath(path!) movieplayer = mpmovieplayercontroller(contenturl: url) if allow player = movieplayer { player.view.frame = self.view.bounds movieplayer?.controlstyle = mpmoviecontrolstylenone player.preparetoplay() player.scalingmode = .aspectfill self.view.addsubview(player.view) } } override func viewdidload() { super.viewdidload() playvideo() } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } }
any help appreciated, give thanks you.
movieplayer!.controlstyle = mpmoviecontrolstyle.none ios 8 , 9
ios swift
Comments
Post a Comment