{"action":"created","issue":{"url":"https://api.github.com/repos/oney/react-native-webrtc/issues/142","repository_url":"https://api.github.com/repos/oney/react-native-webrtc","labels_url":"https://api.github.com/repos/oney/react-native-webrtc/issues/142/labels{/name}","comments_url":"https://api.github.com/repos/oney/react-native-webrtc/issues/142/comments","events_url":"https://api.github.com/repos/oney/react-native-webrtc/issues/142/events","html_url":"https://github.com/oney/react-native-webrtc/issues/142","id":180630530,"number":142,"title":"Android 4.1 (API 16)","user":{"login":"davidperrenoud","id":639875,"avatar_url":"https://avatars.githubusercontent.com/u/639875?v=3","gravatar_id":"","url":"https://api.github.com/users/davidperrenoud","html_url":"https://github.com/davidperrenoud","followers_url":"https://api.github.com/users/davidperrenoud/followers","following_url":"https://api.github.com/users/davidperrenoud/following{/other_user}","gists_url":"https://api.github.com/users/davidperrenoud/gists{/gist_id}","starred_url":"https://api.github.com/users/davidperrenoud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidperrenoud/subscriptions","organizations_url":"https://api.github.com/users/davidperrenoud/orgs","repos_url":"https://api.github.com/users/davidperrenoud/repos","events_url":"https://api.github.com/users/davidperrenoud/events{/privacy}","received_events_url":"https://api.github.com/users/davidperrenoud/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-03T12:40:56Z","updated_at":"2016-10-04T11:06:45Z","closed_at":null,"body":"Has anyone tried using this module on Android 4.1? I get the following error:\r\n\r\n```\r\nE/AndroidRuntime: FATAL EXCEPTION: main\r\njava.lang.NoSuchMethodError: com.oney.WebRTCModule.WebRTCView.isInLayout\r\n   at com.oney.WebRTCModule.WebRTCView.requestSurfaceViewRendererLayout(WebRTCView.java:317)\r\n```\r\n\r\nI think we should add some Android Support Library."},"comment":{"url":"https://api.github.com/repos/oney/react-native-webrtc/issues/comments/251359036","html_url":"https://github.com/oney/react-native-webrtc/issues/142#issuecomment-251359036","issue_url":"https://api.github.com/repos/oney/react-native-webrtc/issues/142","id":251359036,"user":{"login":"davidperrenoud","id":639875,"avatar_url":"https://avatars.githubusercontent.com/u/639875?v=3","gravatar_id":"","url":"https://api.github.com/users/davidperrenoud","html_url":"https://github.com/davidperrenoud","followers_url":"https://api.github.com/users/davidperrenoud/followers","following_url":"https://api.github.com/users/davidperrenoud/following{/other_user}","gists_url":"https://api.github.com/users/davidperrenoud/gists{/gist_id}","starred_url":"https://api.github.com/users/davidperrenoud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidperrenoud/subscriptions","organizations_url":"https://api.github.com/users/davidperrenoud/orgs","repos_url":"https://api.github.com/users/davidperrenoud/repos","events_url":"https://api.github.com/users/davidperrenoud/events{/privacy}","received_events_url":"https://api.github.com/users/davidperrenoud/received_events","type":"User","site_admin":false},"created_at":"2016-10-04T11:06:45Z","updated_at":"2016-10-04T11:06:45Z","body":"So, just some small changes were needed in `WebRTCView.java`:\r\n```java\r\nimport android.support.v4.view.ViewCompat;\r\n```\r\n\r\nIn `requestSurfaceViewRendererLayout`:\r\n\r\n```java\r\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {\r\n            if (!isInLayout()) {\r\n                onLayout(\r\n                    /* changed */ false,\r\n                        getLeft(), getTop(), getRight(), getBottom());\r\n            }\r\n        }\r\n```\r\n\r\nIndeed, `ViewCompat.isInLayout()` does not seem to exist with build tools < 24.0.0 and the method would anyway return `false` for API level < 18.\r\n\r\nIn `tryAddRendererToVideoTrack`:\r\n\r\n```java\r\n    private void tryAddRendererToVideoTrack() {\r\n        if (videoRenderer == null\r\n                && videoTrack != null\r\n                && ViewCompat.isAttachedToWindow(WebRTCView.this)) {\r\n```"}}
{"actor":{"display_login":"davidperrenoud"}}