local UICommonPlayMovie = UIViewClass() local PATH = "Movie/%s" function UICommonPlayMovie:OnCreated() self.controller_Movie:SetAndroidOESEnabled(true) end function UICommonPlayMovie:OnOpened(context) self:RegistSystemEvent(EventID.UI_SyncTeamPVP_MatchSuccess, self.ShutdownCloseCallBack) self.MovieName = context.MovieName self.closeCallBack = context.closeCallBack UIUtils.SetActive(self.btn_Skip, false) self:PlayMovieFunction() end function UICommonPlayMovie:ShutdownCloseCallBack() self.closeCallBack = nil end function UICommonPlayMovie:OnClosed() if self.closeCallBack then self.closeCallBack(self.isSkip) end end function UICommonPlayMovie:OnBackButtonPressed() self:OnButtonClicked(self.btn_Skip) end function UICommonPlayMovie:OnButtonClicked(comp) if comp == self.img_Bottom then UIUtils.SetActive(self.btn_Skip, true) elseif comp == self.btn_Skip then self.isSkip = true self.controller_Movie:StopMovie(true) end end function UICommonPlayMovie:PlayMovieFunction() self.controller_Movie:AddFinishCallBack(function() self:CloseView() end) local volume = CTL.Setting.GetSoundVolume() self.controller_Movie:PlayMovie(string.format(PATH, self.MovieName), volume) end return UICommonPlayMovie