{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/952","labels_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/952/labels{/name}","comments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/952/comments","events_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/952/events","html_url":"https://github.com/facebook/AsyncDisplayKit/pull/952","id":122927531,"number":952,"title":"[ASVideoNode] Basic Video node using AVPlayerLayer.","user":{"login":"lappp9","id":432875,"avatar_url":"https://avatars.githubusercontent.com/u/432875?v=3","gravatar_id":"","url":"https://api.github.com/users/lappp9","html_url":"https://github.com/lappp9","followers_url":"https://api.github.com/users/lappp9/followers","following_url":"https://api.github.com/users/lappp9/following{/other_user}","gists_url":"https://api.github.com/users/lappp9/gists{/gist_id}","starred_url":"https://api.github.com/users/lappp9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lappp9/subscriptions","organizations_url":"https://api.github.com/users/lappp9/orgs","repos_url":"https://api.github.com/users/lappp9/repos","events_url":"https://api.github.com/users/lappp9/events{/privacy}","received_events_url":"https://api.github.com/users/lappp9/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/labels/CLA%20Signed","name":"CLA Signed","color":"bfe5bf"},{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/labels/feature%20%E2%80%94%20core","name":"feature — core","color":"207de5"},{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/labels/feature%20%E2%80%94%20major","name":"feature — major","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/milestones/7","html_url":"https://github.com/facebook/AsyncDisplayKit/milestones/2.0","labels_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/milestones/7/labels","id":1164099,"number":7,"title":"2.0","description":null,"creator":{"login":"appleguy","id":565251,"avatar_url":"https://avatars.githubusercontent.com/u/565251?v=3","gravatar_id":"","url":"https://api.github.com/users/appleguy","html_url":"https://github.com/appleguy","followers_url":"https://api.github.com/users/appleguy/followers","following_url":"https://api.github.com/users/appleguy/following{/other_user}","gists_url":"https://api.github.com/users/appleguy/gists{/gist_id}","starred_url":"https://api.github.com/users/appleguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appleguy/subscriptions","organizations_url":"https://api.github.com/users/appleguy/orgs","repos_url":"https://api.github.com/users/appleguy/repos","events_url":"https://api.github.com/users/appleguy/events{/privacy}","received_events_url":"https://api.github.com/users/appleguy/received_events","type":"User","site_admin":false},"open_issues":18,"closed_issues":3,"state":"open","created_at":"2015-06-15T00:41:47Z","updated_at":"2015-12-19T18:12:13Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-12-18T10:57:53Z","updated_at":"2015-12-19T19:21:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/pulls/952","html_url":"https://github.com/facebook/AsyncDisplayKit/pull/952","diff_url":"https://github.com/facebook/AsyncDisplayKit/pull/952.diff","patch_url":"https://github.com/facebook/AsyncDisplayKit/pull/952.patch"},"body":"Here's a start at the video nodes with autoPlay and autoRepeat functionality.  The main property is the .asset property which can be set with any AVAsset object.  You can also add your own playButtonNode.  I also added two example apps, one called \"Nic Cage TableView\" and the other called \"Videos\".\r\n\r\nI'm sure there's still performance stuff to do before it's really ready but I'd be interested to get some feedback on what's there.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/comments/166017300","html_url":"https://github.com/facebook/AsyncDisplayKit/pull/952#issuecomment-166017300","issue_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/952","id":166017300,"user":{"login":"Adlai-Holler","id":2466893,"avatar_url":"https://avatars.githubusercontent.com/u/2466893?v=3","gravatar_id":"","url":"https://api.github.com/users/Adlai-Holler","html_url":"https://github.com/Adlai-Holler","followers_url":"https://api.github.com/users/Adlai-Holler/followers","following_url":"https://api.github.com/users/Adlai-Holler/following{/other_user}","gists_url":"https://api.github.com/users/Adlai-Holler/gists{/gist_id}","starred_url":"https://api.github.com/users/Adlai-Holler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Adlai-Holler/subscriptions","organizations_url":"https://api.github.com/users/Adlai-Holler/orgs","repos_url":"https://api.github.com/users/Adlai-Holler/repos","events_url":"https://api.github.com/users/Adlai-Holler/events{/privacy}","received_events_url":"https://api.github.com/users/Adlai-Holler/received_events","type":"User","site_admin":false},"created_at":"2015-12-19T19:21:38Z","updated_at":"2015-12-19T19:21:38Z","body":"Woot! This is an excellent first pass and I can't wait to put this component to good work. Since @appleguy already covered the implementation, and since I'm greedy, this will basically amount to feature requests :smile: . Playing video in iOS, the complexity can skyrocket really quickly, so I'm not necessarily pushing for all these immediately.\r\n\r\nMuting/unmuting audio. This would mean adding a `muted` property to the node, and applying that to the latest player whenever either changes. If we add a delegate callback (or KVO but… eh…) for observing mutedness then users can implement their own mute/unmute toggle button. Giving them a default mute/unmute button sounds noble but would need a lot more consideration of value.\r\n\r\nIt would be valuable to detect when the video has reached the end time – here are a couple ways to pull it off:\r\n- Make `currentItem` public, and client observes `AVPlayerItemDidPlayToEndTimeNotification`. Pro: very little code on our end, consistent with non-ASDK usage. Con: Need to inform client when player item changes, may be cumbersome for user to handle the common use case of \"I don't care what item is playing, I want to know when this node finishes playing.\"\r\n- Create a delegate method for it. Pro: Very little code on client's end, could even have a `shouldAutorepeat` option for the delegate to make the call, we are already observing the AVFoundation notification internally anyway. Con: none, really. \r\n\r\nI think the best approach is actually to do both of the above. I can't think of a reason to hide the player item. Clients may want to seek to a particular point, configure the audio mix, etc. There's so much functionality that we could safely offer users, that it might be worth informing the delegate when the current item changes so that they can configure it, or providing a `playerItemConfigurationBlock`.\r\n\r\nLooking to the future, helping to handle buffering would be a great feature – perhaps by default showing/hiding the spinner during buffering and informing the delegate so they can handle it in other ways if desired. Observing a combination of `AVPlayerItemPlaybackStalledNotification`, `AVPlayer.rate`, `AVPlayerItem.playbackBufferEmpty`, and `AVPlayerItem.playbackLikelyToKeepUp`."}}