{"id":18367687,"url":"https://github.com/jwplayer/jwplatform-java","last_synced_at":"2025-04-06T16:32:51.052Z","repository":{"id":46290780,"uuid":"219861695","full_name":"jwplayer/jwplatform-java","owner":"jwplayer","description":":coffee: Java client for the JW Platform API","archived":false,"fork":false,"pushed_at":"2023-06-14T22:29:36.000Z","size":79,"stargazers_count":7,"open_issues_count":1,"forks_count":9,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-22T03:51:12.857Z","etag":null,"topics":["java","jwplatform","jwplayer"],"latest_commit_sha":null,"homepage":"https://developer.jwplayer.com/jw-platform/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jwplayer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-05T22:21:58.000Z","updated_at":"2024-09-02T16:41:18.000Z","dependencies_parsed_at":"2024-11-05T23:36:52.362Z","dependency_job_id":null,"html_url":"https://github.com/jwplayer/jwplatform-java","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwplayer%2Fjwplatform-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwplayer%2Fjwplatform-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwplayer%2Fjwplatform-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jwplayer%2Fjwplatform-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jwplayer","download_url":"https://codeload.github.com/jwplayer/jwplatform-java/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247513077,"owners_count":20950986,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","jwplatform","jwplayer"],"created_at":"2024-11-05T23:22:57.369Z","updated_at":"2025-04-06T16:32:50.772Z","avatar_url":"https://github.com/jwplayer.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JW Platform API Client\n\nThe JWPlatform library provides convenient access to the\n[JW Platform](https://www.jwplayer.com/products/jwplatform/)\nManagement API from applications written in the Java language.\n\nVisit [JW Player Developer site](https://developer.jwplayer.com/jw-platform/)\nfor more information about JW Platform API.\n\n## Requirements\n\nJava 8 and later.\n\n# Install With Maven:\n\nAdd this dependency to your project's POM:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.jwplayer\u003c/groupId\u003e\n  \u003cartifactId\u003ejwplatform\u003c/artifactId\u003e\n  \u003cversion\u003e1.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n# V2 Client ##\n\n## Usage\n\nThe following is an example of how to use the V2 client, MediaClient, used to access all media v2 api routes:\n\n```java\n\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport org.json.JSONArray;\nimport org.json.JSONObject;\n\nimport com.jwplayer.jwplatform.client.MediaClient;\nimport com.jwplayer.jwplatform.exception.JWPlatformException;\n\npublic class Example {\n\n\tpublic static void main(String[] args) {\n\t\tString apiSecret = \"secret\";\n\n\t\ttry {\n\t\t\tMediaClient client = MediaClient.getClient(apiSecret);\n\n\t\t\t// Query params\n\t\t\tMap\u003cString, String\u003e params = new HashMap\u003c\u003e();\n\t\t\tparams.put(\"page_length\", \"10\");\n\t\t\tJSONObject listMediaResponse = client.listAllMedia(\"yourSiteId\", params);\n\t\t\tSystem.out.println(listMediaResponse);\n\n\t\t\t// Show the list of media for the site Id\n\t\t\tJSONArray media = (JSONArray) listMediaResponse.getJSONArray(\"media\");\n\t\t\tSystem.out.println(media);\n\t\t} catch (JWPlatformException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n}\n\n```\n\n## V1 Client ##\n\nThe V1 Client remains available for use, but is deprecated. **We strongly recommend using the V2 Client.**\n\n## Usage\n\nThe following is an example of how to use the V1 client for a video of sourcetype `url`:\n\n```java\n\nimport com.jwplayer.jwplatform.v1.JWPlatformClient;\nimport com.jwplayer.jwplatform.exception.JWPlatformException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport org.json.JSONObject;\n\npublic class JWPlatformClientExample {\n\n    public static void main(String[] args) {\n        String apiKey = \"key\";\n        String apiSecret = \"secret\";\n\n        String videosCreatePath = \"videos/create\";\n        Map\u003cString, String\u003e videosCreateParams = new HashMap\u003c\u003e();\n        videosCreateParams.put(\"sourcetype\", \"url\");\n        videosCreateParams.put(\"sourceformat\", \"mp4\");\n        videosCreateParams.put(\"sourceurl\", \"http://www.some-url.com/some-video.mp4\");\n        videosCreateParams.put(\"title\", \"Some Video Title\");\n\n        String videosShowPath = \"/videos/show\";\n        \n        try {            \n            JWPlatformClient client = JWPlatformClient.create(apiKey, apiSecret);\n            \n            // Create a video asset\n            JSONObject videosCreateResponse = client.request(videosCreatePath, videosCreateParams);\n            System.out.println(videosCreateResponse);\n            \n            // Show the properties of the created video\n            String videoKey = videosCreateResponse.getJSONObject(\"video\").getString(\"key\");\n            Map\u003cString, String\u003e videosShowParams = new HashMap\u003c\u003e();\n            videosShowParams.put(\"video_key\", videoKey);\n            JSONObject videosShowResponse = client.request(videosShowPath, videosShowParams);\n            System.out.println(videosShowResponse);\n        } catch (JWPlatformException e) {\n            e.printStackTrace();\n        }\n    }\n}\n\n```\n\nThe following is an example of how to use the client for a video of sourcetype `file`:\n\n```java\n\nimport com.jwplayer.jwplatform.JWPlatformClient;\nimport com.jwplayer.jwplatform.exception.JWPlatformException;\nimport java.util.HashMap;\nimport java.util.Map;\nimport org.json.JSONObject;\n\npublic class JWPlatformClientExample {\n\n    public static void main(String[] args) {\n    String apiKey = \"key\";\n    String apiSecret = \"secret\";\n\n    String videosCreatePath = \"/videos/create\";\n    Map\u003cString, String\u003e videosCreateParams = new HashMap\u003c\u003e();\n    videosCreateParams.put(\"sourcetype\", \"file\");\n    videosCreateParams.put(\"title\", \"Some Video Title\");\n\n    String localFilePath = \"/some/path/test_video.mp4\";\n\n    try {\n        JWPlatformClient client = JWPlatformClient.create(apiKey, apiSecret);\n\n        // Create a video asset\n        JSONObject videosCreateResponse = client.request(videosCreatePath, videosCreateParams);\n        System.out.println(videosCreateResponse);\n\n        // Upload the video from local file system\n        JSONObject videoUploadResponse = client.upload(videosCreateResponse, localFilePath);\n        System.out.println(videoUploadResponse);\n    } catch (JWPlatformException e) {\n        e.printStackTrace();\n    }\n}\n```\n_**Note**_\n\nIn the preceding **V1 example** snippets, all URL paths feature a leading slash. These must be included\nfor the URL builder to work properly.\n\n## Supported operations\n\nAll API methods documented in our api documentation are available in this client. \nPlease refer to our [api documentation](https://developer.jwplayer.com/jwplayer/reference).\n\n## ChangeLog \nSee the [Change Log](CHANGELOG.md) for recent changes.\n\n## License\n\nJW Platform API library is distributed under the\n[Apache 2 license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwplayer%2Fjwplatform-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjwplayer%2Fjwplatform-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjwplayer%2Fjwplatform-java/lists"}