{"id":16712,"date":"2016-12-22T13:37:56","date_gmt":"2016-12-22T18:37:56","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=16712"},"modified":"2016-12-22T13:37:56","modified_gmt":"2016-12-22T18:37:56","slug":"fixing-avplayer-playback-transparency","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2016\/12\/22\/fixing-avplayer-playback-transparency\/","title":{"rendered":"Fixing AVPlayer Playback Transparency"},"content":{"rendered":"<p><a href=\"http:\/\/ashleynh.me\/fixing-avplayer-playback-transparency\/\">Ashley\nNelson-Hornstein<\/a>:<\/p>\n<blockquote cite=\"http:\/\/ashleynh.me\/fixing-avplayer-playback-transparency\/\"><p>To test this theory, I downloaded one of the videos made in the client&rsquo;s app, dropped it into Apple&rsquo;s example project, and made a couple of quick changes so that Apple&rsquo;s project would use the video I added instead of one selected from Camera Roll. I ran the project and <em>voil&agrave;<\/em>, the same initial flash of transparency reproduced in the example project.<\/p><p>[&#8230;]<\/p><p>This &ldquo;empty edit&rdquo; sounded exactly like what was being inserted into the beginning of the client&rsquo;s app-created videos. I looked at how the client&rsquo;s app was appending buffers to <a href=\"https:\/\/developer.apple.com\/reference\/avfoundation\/avassetwriterinput\">AVAssetWriterInput<\/a> and noticed that the code never ensured the <strong>first<\/strong> buffer appended to the file had the same time as the <code>startTime<\/code> of the video.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Ashley Nelson-Hornstein: To test this theory, I downloaded one of the videos made in the client&rsquo;s app, dropped it into Apple&rsquo;s example project, and made a couple of quick changes so that Apple&rsquo;s project would use the video I added instead of one selected from Camera Roll. I ran the project and voil&agrave;, the same [&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,131,31,1380,71,97],"class_list":["post-16712","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-avfoundation","tag-bug","tag-ios","tag-ios-10","tag-programming","tag-video"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/16712","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=16712"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/16712\/revisions"}],"predecessor-version":[{"id":16713,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/16712\/revisions\/16713"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=16712"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=16712"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=16712"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}