{"action":"closed","issue":{"url":"https://api.github.com/repos/processing/processing/issues/5596","repository_url":"https://api.github.com/repos/processing/processing","labels_url":"https://api.github.com/repos/processing/processing/issues/5596/labels{/name}","comments_url":"https://api.github.com/repos/processing/processing/issues/5596/comments","events_url":"https://api.github.com/repos/processing/processing/issues/5596/events","html_url":"https://github.com/processing/processing/issues/5596","id":345512239,"node_id":"MDU6SXNzdWUzNDU1MTIyMzk=","number":5596,"title":"Movie.isPlaying()","user":{"login":"kfrajer","id":26076840,"node_id":"MDQ6VXNlcjI2MDc2ODQw","avatar_url":"https://avatars3.githubusercontent.com/u/26076840?v=4","gravatar_id":"","url":"https://api.github.com/users/kfrajer","html_url":"https://github.com/kfrajer","followers_url":"https://api.github.com/users/kfrajer/followers","following_url":"https://api.github.com/users/kfrajer/following{/other_user}","gists_url":"https://api.github.com/users/kfrajer/gists{/gist_id}","starred_url":"https://api.github.com/users/kfrajer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kfrajer/subscriptions","organizations_url":"https://api.github.com/users/kfrajer/orgs","repos_url":"https://api.github.com/users/kfrajer/repos","events_url":"https://api.github.com/users/kfrajer/events{/privacy}","received_events_url":"https://api.github.com/users/kfrajer/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-29T08:16:07Z","updated_at":"2018-07-29T17:41:18Z","closed_at":"2018-07-29T17:41:18Z","author_association":"NONE","body":"<!--- ** Before posting, please search Issues for duplicates  ** --> \r\nPossible duplicate: https://github.com/processing/processing/issues/1327 also a PR already exist: https://github.com/processing/processing-video/pull/29\r\n\r\n## Description\r\nFeature request: Add function `isPlaying()` to the movie library to detect when a movie ends playing\r\n\r\n## Expected Behavior\r\n\r\n\r\n## Current Behavior\r\nNo method available atm. Users fall back to `time()` and `duration()` methods to check if the current movie is still playing. \r\n\r\n## Steps to Reproduce\r\n\r\nCurrently this a code to play three movies one after the other, looping all three. Adding this feature will reduce complexity. Next demo based on GoToLoop's demonstration:\r\n\r\n```java\r\n//===========================================================================\r\n// IMPORTS:\r\nimport processing.video.*;\r\n\r\n//===========================================================================\r\n// FINAL FIELDS:\r\nfinal int N=3;\r\n\r\n//===========================================================================\r\n// GLOBAL VARIABLES:\r\n\r\nMovie[] mov;\r\nint cidx=0;\r\n\r\n//===========================================================================\r\n// PROCESSING DEFAULT FUNCTIONS:\r\n\r\nvoid settings() {\r\n  size(400, 600);\r\n}\r\n\r\nvoid setup() {\r\n  mov = new Movie[N];\r\n  mov[0]=new Movie(this, \"processing-movie.mp4\") {\r\n    @Override public boolean hasBufferSink() {\r\n      return playing;\r\n    }\r\n  };\r\n  mov[1]=new Movie(this, \"transit.mov\") {\r\n    @Override public boolean hasBufferSink() {\r\n      return playing;\r\n    }\r\n  };\r\n  mov[2]=new Movie(this, \"video720x480.mp4\") {\r\n    @Override public boolean hasBufferSink() {\r\n      return playing;\r\n    }\r\n  };\r\n\r\n  mov[cidx].play();  //Start playing first movie\r\n}\r\n\r\nvoid movieEvent(Movie m) {\r\n  m.read();\r\n}\r\n\r\nvoid draw() {\r\n  background(0);\r\n  image(mov[cidx], 0, 0, width, height);\r\n  \r\n  //B&W info banner\r\n  fill(255);\r\n  text(\"Current \"+cidx, 10, 30);\r\n  fill(0);\r\n  text(\"Current \"+cidx, 10, 50);\r\n\r\n  checkCurrentMovieStatus();\r\n}\r\n\r\n//===========================================================================\r\n// OTHER FUNCTIONS:\r\n\r\nvoid checkCurrentMovieStatus() {\r\n\r\n  if (mov[cidx].hasBufferSink()==false) {\r\n\r\n    mov[cidx].stop();  //Rewind \r\n    cidx=(cidx+1)%N;    \r\n    mov[cidx].play();\r\n  }\r\n}\r\n```\r\n\r\n## Your Environment\r\nP3.3.7 Win10 x64\r\n\r\n## Possible Causes / Solutions\r\nDiscussion in [this post](https://discourse.processing.org/t/help-with-text-and-video/2104/10) suggest to expose the `playing` field via `isPlaying()` method."}}
{"actor":{"display_login":"gohai"}}