public ArrayList<MovieVideo> processJSON(JSONObject json) throws JSONException { JSONArray jsonArray = json.getJSONArray("results"); ArrayList<MovieVideo> movieVideos = new ArrayList<MovieVideo>(); for (int index = 0; index < jsonArray.length(); index++) { JSONObject object = jsonArray.getJSONObject(index); MovieVideo movieVideo = new MovieVideo(); String site = object.getString("site"); String key = object.getString("key"); String[] videoUrls = Utils.getVideoUrls(key, site); movieVideo.setId(object.getString("id")); movieVideo.setName(object.getString("name")); movieVideo.setImageUrl(videoUrls[0]); movieVideo.setVideoUrl(videoUrls[1]); movieVideos.add(movieVideo); } return movieVideos; }