{"id":18793,"date":"2017-09-01T20:49:26","date_gmt":"2017-09-02T00:49:26","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=18793"},"modified":"2017-09-01T20:49:26","modified_gmt":"2017-09-02T00:49:26","slug":"too-many-avplayers","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2017\/09\/01\/too-many-avplayers\/","title":{"rendered":"Too Many AVPlayers?"},"content":{"rendered":"<p><a href=\"http:\/\/beckyhansmeyer.com\/2017\/08\/30\/too-many-avplayers\/\">Becky Hansmeyer<\/a>:<\/p>\n<blockquote cite=\"http:\/\/beckyhansmeyer.com\/2017\/08\/30\/too-many-avplayers\/\">\n<p>I always made sure to set the <code>AVPlayer<\/code> to <code>nil<\/code> before re-generating the preview, so I couldn&rsquo;t figure out why there would be any other &ldquo;actions that decode media.&rdquo; A trip to <a href=\"https:\/\/stackoverflow.com\/a\/9933853\/3971711\">Stack Overflow<\/a> revealed a possible platform limitation on the number of video &ldquo;render pipelines&rdquo; shared between apps on the device. It turns out that <em>setting the AVPlayer to nil does <em>not<\/em> free up a playback pipeline and that it is actually the association of a playerItem with a player that creates the pipeline in the first place<\/em>. Since developers don&rsquo;t seem to have any control over when these resources are released, I knew I&rsquo;d have to figure out another solution.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Becky Hansmeyer: I always made sure to set the AVPlayer to nil before re-generating the preview, so I couldn&rsquo;t figure out why there would be any other &ldquo;actions that decode media.&rdquo; A trip to Stack Overflow revealed a possible platform limitation on the number of video &ldquo;render pipelines&rdquo; shared between apps on the device. It [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[273,69,31,1380,71,901,97],"class_list":["post-18793","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-avfoundation","tag-cocoa","tag-ios","tag-ios-10","tag-programming","tag-swift-programming-language","tag-video"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/18793","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=18793"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/18793\/revisions"}],"predecessor-version":[{"id":18794,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/18793\/revisions\/18794"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=18793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=18793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=18793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}