private void CommandBarPauseMovieSelected() { if (InnerState == ViewerState.MoviePlayback && MoviePlayer.Visibility.IsVisible()) { MoviePlayer.Pause(); } }
private bool PlayMovie() { SongInformation current = currentParent.Children[CurrentThumbList.CurrentIndex]; if (current.IsPPDSong) { if (currentPlaying != current) { StopMovie(); var movie = myGame.GetMovie(current); var moviePlayer = new MoviePlayer(device, movie, current, CurrentThumbList[CurrentThumbList.CurrentIndex] as LoadablePictureComponent); moviePlayer.PlayNext += moviePlayer_PlayNext; movieSprite.AddChild(moviePlayer); playing = true; currentPlaying = current; movieController.MoviePlayer = moviePlayer; if (FocusManager.CurrentFocusObject != movieController) { FocusManager.Focus(movieController); } } return(true); } return(false); }
/// <summary> /// Start playing a movie on a seperate thread /// </summary> /// <param name="movie">Movie to play</param> /// <param name="resume">Ask user to resume?</param> private static void DoPlayMovie(DBMovieInfo movie, bool resume, int startPosition) { if (GUIGraphicsContext.form.InvokeRequired) { PlayMovieAsyncDelegate d = new PlayMovieAsyncDelegate(DoPlayMovie); GUIGraphicsContext.form.Invoke(d, new object[] { movie, resume, startPosition }); return; } WifiRemote.LogMessage("Play movie (resume: " + resume + ", pos: " + startPosition, WifiRemote.LogType.Debug); // Clear resume if (!resume && movie.UserSettings != null && movie.UserSettings.Count > 0) { DBUserMovieSettings userSetting = movie.ActiveUserSettings; userSetting.ResumePart = 0; userSetting.ResumeTime = 0; userSetting.ResumeData = null; userSetting.Commit(); } if (player == null) { player = new MoviePlayer(new MovingPicturesGUI()); } player.Play(movie); if (!resume && startPosition > 0) { g_Player.SeekAbsolute(startPosition); } }
void TryPlayMedia( ) { ResultView.Hide( ); if (HideProgressIndicator == false) { ActivityIndicator.Hidden = false; } else { ActivityIndicator.Hidden = true; } DidDisplayError = false; // if we're watching the same video we last watched, resume if (MediaUrl == MobileApp.Shared.Network.RockMobileUser.Instance.LastStreamingMediaUrl) { MoviePlayer.InitialPlaybackTime = MobileApp.Shared.Network.RockMobileUser.Instance.LastStreamingMediaPos; } MoviePlayer.ContentUrl = new NSUrl(MediaUrl); MoviePlayer.PrepareToPlay( ); }
private void uploadButton_Click(object sender, EventArgs eventArgs) { var openFileDialog = new OpenFileDialog { CheckFileExists = true, AddExtension = true, Multiselect = false, Filter = "SRT Files (*.srt)|*.srt" }; var dialogResponse = openFileDialog.ShowDialog(); if (dialogResponse == DialogResult.OK) { // Get the quotes var fileReader = new FileReader(openFileDialog.FileName); var quoteReader = new QuoteReader(fileReader); var quotes = quoteReader.GetAllQuotes(); // Get the corresponding movie file string moviePath = openFileDialog.FileName.Replace(".srt", ".mp4"); var moviePlayer = new MoviePlayer(moviePath, vlcControl); // Generate a button for each quote. Clicking on the button will play the quote. foreach (var quote in quotes) { BuildQuoteButton(quote, moviePlayer); } } }
void ContentPreloadDidFinish(NSNotification obj) { // once the movie is ready, hide the spinner if (MoviePlayer.PlaybackState != MPMoviePlaybackState.Playing) { ActivityIndicator.Hidden = true; // jump to the spot that was preloaded. MoviePlayer.CurrentPlaybackTime = MoviePlayer.InitialPlaybackTime; MoviePlayer.Play( ); // now that the content is preloaded, update our layout so that // we size the window according to the video dimensions. LayoutChanged( ); if (AudioOnly) { MessageAnalytic.Instance.Trigger(MessageAnalytic.Listen, Name); } else { MessageAnalytic.Instance.Trigger(MessageAnalytic.Watch, Name); } } }
protected override void Awake() { base.Awake(); this.AssertRequiredObjects(movieImage, fadeImage); moviePlayer = Engine.GetService <MoviePlayer>(); }
void Update() { if (Input.GetKey("left ctrl")) { LinkedListNode <MoviePlayer> elem = MoviePlayers.First; LinkedListNode <MoviePlayer> next = null; while (elem != null) { next = elem.Next; MoviePlayer player = elem.Value; if (player == null) { MoviePlayers.Remove(elem); } else { if (!player.Loop && !player.inWorld) { player.StopVideo(); } else { Logger.LogInfo($"not skipping, Loop: {player.Loop}, inWorld: {player.inWorld}"); } } elem = next; } // if (!skippedSplash && GameManager.instance.Hud.State == HudState.Start && UnitySceneManager.GetActiveScene().name == "Global Module") { // UnitySceneManager.LoadScene("Start Menu"); // skippedSplash = true; // } } }
public static MoviePlayer CreateMoviePlayer(MoviePlayerSettings moviePlayerSettings) { GameObject moviePlayerGO = new GameObject("MoviePlayer"); MoviePlayer moviePlayer = moviePlayerGO.AddComponent <MoviePlayer>(); moviePlayer._moviePlayerSettings = moviePlayerSettings; return(moviePlayer); }
internal void PlayMovingPicture(int index) { if (moviePlayer == null) { moviePlayer = new MoviePlayer(new MovingPicturesGUI()); } moviePlayer.Play((DBMovieInfo)latestMovingPictures[index]); }
public override void ViewDidAppear(bool animated) { base.ViewDidAppear(animated); if (MoviePlayer != null) { MoviePlayer.SourceType = MPMovieSourceType.Streaming; MoviePlayer.ContentUrl = Url; MoviePlayer.Play(); } }
public void AudienceWatching() { var expected = "we are watching"; var mp = new MoviePlayer(new MovieMX()); var au = new Audience(new MovieMX()); au.GoPlaying(mp); mp.PlayMovie(); Assert.AreEqual(expected, au.response); }
void DisplayError( ) { DidDisplayError = true; ResultView.Show(MessagesStrings.Error_Title, PrivateControlStylingConfig.Result_Symbol_Failed, MessagesStrings.Error_Watch_Playback, GeneralStrings.Retry); MoviePlayer.Stop( ); ActivityIndicator.Hidden = true; }
public void AudienceShouldDo() { var m = new MovieUS(); var mp = new MoviePlayer(m); AudienceStuff play = () => { return(new MoviePlayer(new MovieCA()).Play()); }; Action <int> compute = (i) => { System.Console.WriteLine(i); }; var expected = "play " + typeof(MovieCA).ToString(); var actual = Audience.DoAction(play); Audience.Pause1 x = (i, b) => { return(string.Empty); }; Assert.IsTrue(expected == actual); }
void Start () { m_Movie = this.gameObject.GetComponent<MoviePlayer> (); List<Id> ids = UnityEngine.Object.FindObjectsOfType<Id>().ToList(); foreach(Id i in ids) { if(i.ObjectId == m_Movie.m_TargetID) { m_Monitor = i.gameObject; } } m_AudioStack = m_Monitor.GetComponent<AudioStack> (); }
// Use this for initialization void Start() { mp = movie.GetComponent <MoviePlayer> (); mp.Play(); this.hideQuestions(); //changeQuestionText ("Do this", "Do that", "Don't do anything", "Help, I'm stuck on this project"); //correct = 2; Cursor.visible = true; Cursor.lockState = CursorLockMode.None; this.hideQuestions(); }
public virtual RCOState execute(RCOState state, UmdVideoPlayer umdVideoPlayer, string resourceName) { if (pVSMXTable != RCO_NULL_PTR) { StringBuilder vsmxName = new StringBuilder(); VSMX vsmx = new VSMX(readVSMX(pVSMXTable, vsmxName), vsmxName.ToString()); state.interpreter.VSMX = vsmx; state.globalVariables = GlobalVariables.create(state.interpreter); state.globalVariables.setPropertyValue(Controller.objectName, state.controller); state.globalVariables.setPropertyValue(MoviePlayer.objectName, MoviePlayer.create(state.interpreter, umdVideoPlayer, state.controller)); state.globalVariables.setPropertyValue(Resource.objectName, Resource.create(state.interpreter, umdVideoPlayer.RCODisplay, state.controller, mainTable)); state.globalVariables.setPropertyValue(pspsharp.format.rco.vsmx.objects.Math.objectName, pspsharp.format.rco.vsmx.objects.Math.create(state.interpreter)); state.interpreter.run(state.globalVariables); } return(state); }
public override void ViewWillDisappear(bool animated) { base.ViewWillDisappear(animated); // only process this if we're not entering fullscreen if (EnteringFullscreen == false) { MoviePlayer.Stop( ); foreach (NSObject handle in ObserverHandles) { NSNotificationCenter.DefaultCenter.RemoveObserver(handle); } ObserverHandles.Clear( ); } }
static void Main(string[] args) { DVDMovie lostArk = new DVDMovie { Title = "Raiders of the Lost Ark", Genre = "Action/Adventure", ReleaseDate = new DateTime(1980, 1, 1) }; var player = new MoviePlayer(); MoviePlayer.ShowHandler handler = PrintMessage; // subscribe to an event. player.Show += handler; // unsubscribe from an event. //player.Show -= handler; // now NO delegate is subscribed to the event! //player.Show += handler; MoviePlayer.ShowHandler handler2 = (string s) => Console.WriteLine(s); //void handler2(string s) => Console.WriteLine(s); handler2("Running handler2"); Action <string> handler3 = (string s) => Console.WriteLine(s); var actionDict = new Dictionary <string, Action <string> >(); player.Show += (string s) => Console.WriteLine("Handle with lambda"); player.Show += (string s) => { if (s.Length > 10) { Console.WriteLine("long title"); } }; player.Play(lostArk); }
public Player(MainWindow mainwindow, string filename, long timebase) { try { this.timebase = timebase; this.renderer = mainwindow.Renderer; this.audioout = mainwindow.Audio; this.mixer = mainwindow.Mixer; this.player = BaseLib.Media.MoviePlayer.Open(() => { }, filename); try { if (player.VideoStreams.Length > 0) { this.video = player.open_video(0, frameready); } if (player.AudioStreams.Length > 0) { this.audio = player.open_audio(0, mainwindow.Mixer, audioready); this.audiobuffer = new FifoStream(mainwindow.Audio.SampleSize * mainwindow.Audio.SampleRate * 3); this.mixer.Register(this.audiobuffer, this.audioout.Channels, false); } this.player.start(0, timebase); } catch { Dispose(true); GC.SuppressFinalize(this); throw; } } catch { GC.SuppressFinalize(this); throw; } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.Space(); EditorGUILayout.LabelField("[Debug Test]"); EditorGUILayout.Space(); EditorGUILayout.BeginVertical(); { sampleFilePath = EditorGUILayout.TextField("URL", sampleFilePath); sampleVideoClip = (VideoClip)EditorGUILayout.ObjectField("Clip", (VideoClip)sampleVideoClip, typeof(VideoClip), false); isSkip = EditorGUILayout.Toggle("Skip", isSkip); isLoop = EditorGUILayout.Toggle("Loop", isLoop); if (GUILayout.Button("PlayFromFile")) { MoviePlayer player = target as MoviePlayer; if (player != null) { player.PlayMovie(sampleFilePath, isSkip, isLoop); } } if (GUILayout.Button("PlayFromClip")) { MoviePlayer player = target as MoviePlayer; if (player != null) { player.PlayMovie(sampleVideoClip, isSkip, isLoop); } } } EditorGUILayout.EndVertical(); }
private void BuildQuoteButton(Quote quote, MoviePlayer moviePlayer) { var quoteButton = new QuotePanel(new[] { quote.GetData() }, moviePlayer); quoteButtonPanel.Controls.Add(quoteButton); }
public override void PreStartClient() { movie_player_ = FindObjectOfType<MoviePlayer>(); sound_manager_ = FindObjectOfType<SoundManager>(); base.PreStartClient(); }
public void Awake() { moviePlayer = GetComponent <MoviePlayer>(); //audioSource = GetComponent<AudioSource>(); // Using external audio sources instead }
public void AudienceShouldDo() { var m = new MovieUS(); var mp = new MoviePlayer(m); AudienceStuff play = () => { return(new MoviePlayer(new MovieCA()).Play()); }; Action <int> compute = (i) => { System.Console.WriteLine(i); };
public override void Start() { base.Start(); AudioPlayer = new AudioPlayer(); MoviePlayer = new MoviePlayer(); }
public MovieController(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, MoviePlayer moviePlayer) : base(device) { this.resourceManager = resourceManager; this.moviePlayer = moviePlayer; this.AddChild((moviePos = new TextureString(device, "", 14, PPDColors.White) { Position = new Vector2(0, -9) })); this.AddChild((changeTrimming = new FadableButton(device, resourceManager, Utility.Path.Combine("moviecontroller", "changetrimming.png"), Utility.Path.Combine("moviecontroller", "changetrimming_select.png"), Utility.Language["ChangeTrimming"]) { Position = new SharpDX.Vector2(-60, 0) })); this.AddChild((seekBackward = new FadableButton(device, resourceManager, Utility.Path.Combine("moviecontroller", "seekbackward.png"), Utility.Path.Combine("moviecontroller", "seekbackward_select.png"), Utility.Language["SeekBackward"]) { Position = new SharpDX.Vector2(-30, 0) })); this.AddChild((play = new FadableButton(device, resourceManager, Utility.Path.Combine("moviecontroller", "play.png"), Utility.Path.Combine("moviecontroller", "play_select.png"), Utility.Language["Play"]))); this.AddChild((pause = new FadableButton(device, resourceManager, Utility.Path.Combine("moviecontroller", "pause.png"), Utility.Path.Combine("moviecontroller", "pause_select.png"), Utility.Language["Pause"]))); this.AddChild((stop = new FadableButton(device, resourceManager, Utility.Path.Combine("moviecontroller", "stop.png"), Utility.Path.Combine("moviecontroller", "stop_select.png"), Utility.Language["Stop"]) { Position = new SharpDX.Vector2(30, 0) })); this.AddChild((seekForward = new FadableButton(device, resourceManager, Utility.Path.Combine("moviecontroller", "seekforward.png"), Utility.Path.Combine("moviecontroller", "seekforward_select.png"), Utility.Language["SeekForward"]) { Position = new SharpDX.Vector2(60, 0) })); this.AddChild((getThumb = new FadableButton(device, resourceManager, Utility.Path.Combine("moviecontroller", "getthumb.png"), Utility.Path.Combine("moviecontroller", "getthumb_select.png"), Utility.Language["GetThumb"]) { Position = new SharpDX.Vector2(90, 0) })); this.AddChild((secLoop = new FadableButton(device, resourceManager, Utility.Path.Combine("moviecontroller", "secloop.png"), Utility.Path.Combine("moviecontroller", "secloop_select.png"), Utility.Language["FolderLoop"]) { Position = new SharpDX.Vector2(120, 0) })); this.AddChild((oneLoop = new FadableButton(device, resourceManager, Utility.Path.Combine("moviecontroller", "oneloop.png"), Utility.Path.Combine("moviecontroller", "oneloop_select.png"), Utility.Language["OneLoop"]) { Position = new SharpDX.Vector2(120, 0) })); this.AddChild((randomLoop = new FadableButton(device, resourceManager, Utility.Path.Combine("moviecontroller", "randomloop.png"), Utility.Path.Combine("moviecontroller", "randomloop_select.png"), Utility.Language["RandomLoop"]) { Position = new SharpDX.Vector2(120, 0) })); this.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("moviecontroller", "back.png"), true)); play.Alpha = 0; loopDict = new Dictionary <MovieLoopType, FadableButton> { { MovieLoopType.One, oneLoop }, { MovieLoopType.Sequential, secLoop }, { MovieLoopType.Random, randomLoop } }; foreach (var p in loopDict) { p.Value.Alpha = p.Key == PPDGeneralSetting.Setting.MovieLoopType ? 1 : 0; } list = new FadableButton[] { changeTrimming, seekBackward, pause, stop, seekForward, getThumb, oneLoop }; this.Position = new SharpDX.Vector2(400, 420); Inputed += MovieController_Inputed; GotFocused += MovieController_GotFocused; }
void Start() { if (!isLocalPlayer) return; movie_player_ = movie_.GetComponent<MoviePlayer>(); }
private static void MoviePlayerOnEnable(MoviePlayer __instance) { QuickswapPlugin.MoviePlayers.AddLast(__instance); }
public void Awake() { moviePlayer = GetComponent <MoviePlayer>(); audioSource = GetComponent <AudioSource>(); // change when using external audio sources to reference those instead }
public ContentsGridPage() { this.InitializeComponent(); InitVisualStates(); CommandBarManager.SetEvent(AppBarItem.Ok, async(s, args) => { DebugUtil.Log(() => "Ok clicked"); switch (InnerState) { case ViewerState.Multi: switch (Operator.ContentsCollection.SelectivityFactor) { case SelectivityFactor.Delete: await DeleteSelectedFiles(); break; case SelectivityFactor.Download: FetchSelectedImages(); break; default: DebugUtil.Log(() => "Nothing to do for current SelectivityFactor: " + Operator.ContentsCollection.SelectivityFactor); break; } UpdateSelectionMode(SelectivityFactor.None); UpdateInnerState(ViewerState.Single); break; default: DebugUtil.Log(() => "Nothing to do for current InnerState: " + InnerState); break; } }) .SetEvent(AppBarItem.DeleteMultiple, (s, args) => { UpdateSelectionMode(SelectivityFactor.Delete); UpdateInnerState(ViewerState.Multi); }) .SetEvent(AppBarItem.DownloadMultiple, (s, args) => { UpdateSelectionMode(SelectivityFactor.Download); UpdateInnerState(ViewerState.Multi); }) .SetEvent(AppBarItem.RotateRight, (s, args) => { PhotoScreen.RotateImage(Rotation.Right); }) .SetEvent(AppBarItem.RotateLeft, (s, args) => { PhotoScreen.RotateImage(Rotation.Left); }) .SetEvent(AppBarItem.ShowDetailInfo, async(s, args) => { PhotoScreen.DetailInfoDisplayed = true; await Task.Delay(500); UpdateAppBar(); }) .SetEvent(AppBarItem.HideDetailInfo, async(s, args) => { PhotoScreen.DetailInfoDisplayed = false; await Task.Delay(500); UpdateAppBar(); }) .SetEvent(AppBarItem.Resume, (s, args) => { MoviePlayer.Resume(); }) .SetEvent(AppBarItem.Pause, (s, args) => { MoviePlayer.Pause(); }) .SetEvent(AppBarItem.Close, (s, args) => { switch (InnerState) { case ViewerState.StillPlayback: ReleaseDetail(); break; case ViewerState.MoviePlayback: FinishMoviePlayback(); break; } UpdateInnerState(ViewerState.Single); }) .SetEvent(AppBarItem.LocalStorage, (s, args) => { var tuple = Tuple.Create <string, string>(nameof(StorageType.Local), null); Frame.Navigate(typeof(ContentsGridPage), tuple); }) .SetEvent(AppBarItem.RemoteStorage, (s, args) => { var menuFlyout = CreateRemoteDrivesMenuFlyout(); switch (menuFlyout.Items.Count) { case 0: UpdateTopBar(); break; // case 1: // TODO Transit directly // break; default: FlyoutBase.SetAttachedFlyout(s as FrameworkElement, menuFlyout); FlyoutBase.ShowAttachedFlyout(s as FrameworkElement); break; } }) .SetAccentColor(AppBarItem.RemoteStorage) .SetHeartBeat(AppBarItem.RemoteStorage) .SetEvent(AppBarItem.CancelSelection, (s, args) => { UpdateInnerState(ViewerState.Single); }); PhotoScreen.DetailInfoDisplayStatusUpdated += () => { UpdateAppBar(); }; }
public override void OnEvent(ExecutionContext context) { _moviePlayer = MoviePlayer.CreateMoviePlayer(_moviePlayerSettings); _moviePlayer.OnMovieFinishedPlaying += new Action(moviePlayer_OnMovieFinishedPlaying); _moviePlayer.StartMovie(); }