{"id":19373315,"url":"https://github.com/adrielcafe/androidstreamable","last_synced_at":"2025-04-23T16:34:05.844Z","repository":{"id":149190296,"uuid":"45510358","full_name":"adrielcafe/AndroidStreamable","owner":"adrielcafe","description":"Unofficial https://streamable.com API Wrapper for Android","archived":false,"fork":false,"pushed_at":"2015-11-29T13:47:25.000Z","size":3126,"stargazers_count":27,"open_issues_count":0,"forks_count":11,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-05-21T02:14:56.125Z","etag":null,"topics":["android","library","stream","video"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adrielcafe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-04T02:35:09.000Z","updated_at":"2022-06-19T08:07:36.000Z","dependencies_parsed_at":"2023-04-14T13:00:45.135Z","dependency_job_id":null,"html_url":"https://github.com/adrielcafe/AndroidStreamable","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrielcafe%2FAndroidStreamable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrielcafe%2FAndroidStreamable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrielcafe%2FAndroidStreamable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrielcafe%2FAndroidStreamable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adrielcafe","download_url":"https://codeload.github.com/adrielcafe/AndroidStreamable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223930507,"owners_count":17227093,"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":["android","library","stream","video"],"created_at":"2024-11-10T08:27:49.622Z","updated_at":"2024-11-10T08:27:50.137Z","avatar_url":"https://github.com/adrielcafe.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-AndroidStreamable-green.svg?style=true)](https://android-arsenal.com/details/1/2738)\n[![JitPack](https://img.shields.io/github/release/adrielcafe/AndroidStreamable.svg?label=JitPack)](https://jitpack.io/#adrielcafe/AndroidStreamable/)\n\n\u003cp align=\"center\" style=\"margin: 0\"\u003e\n  \u003cimg src=\"https://streamable.com/static/img/logo.png\"\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\" style=\"margin-top: 0\"\u003eAndroidStreamable\u003c/h1\u003e\n\n**Unofficial** https://streamable.com API Wrapper for Android.\n\n## Usage\n\n### Authentication\nYou don't need to authenticate to use this API. If you do, all uploaded/imported videos will be saved on your Streamable account.\n```java\nAndroidStreamable.setCredentials(\"YOUR_STREAMABLE_USERNAME\", \"YOUR_STREAMABLE_PASSWORD\");\n```\n\n### Upload a video file\nUploads a [NewVideo](https://github.com/adrielcafe/AndroidStreamable/blob/master/androidstreamable/src/main/java/cafe/adriel/androidstreamable/model/NewVideo.java) file to Streamable. Video files must be **smaller than 10GB** in size and **10 minutes in length**.\n```java\nInputStream is = getAssets().open(\"video.mp4\");\n/* or\nFile file = new File(\"video.mp4\"); */\nString title = \"Upload Example\";\nAndroidStreamable.uploadVideo(is /* or file */, title, new NewVideoCallback() {\n\t@Override\n\tpublic void onSuccess(int statusCode, NewVideo newVideo) {\n\t\t// :D\n\t}\n\t@Override\n\tpublic void onFailure(int statusCode, Throwable error) {\n\t\t// :(\n\t}\n});\n```\n\n### Import a video from a URL\nImports a [NewVideo](https://github.com/adrielcafe/AndroidStreamable/blob/master/androidstreamable/src/main/java/cafe/adriel/androidstreamable/model/NewVideo.java) to Streamable from a URL. Video files must be **smaller than 10GB** in size and **10 minutes in length**.\n```java\nString url = \"http://site.com/video.mp4\";\nString title = \"Import Example\";\nAndroidStreamable.importVideo(url, title, new NewVideoCallback() {\n\t@Override\n\tpublic void onSuccess(int statusCode, NewVideo newVideo) {\n\t\t// :D\n\t}\n\t@Override\n\tpublic void onFailure(int statusCode, Throwable error) {\n\t\t// :(\n\t}\n});\n```\n\n### Retrieve a video\nRetrieves a [Video](https://github.com/adrielcafe/AndroidStreamable/blob/master/androidstreamable/src/main/java/cafe/adriel/androidstreamable/model/Video.java) that has previously been uploaded or imported.\n```java\nString shortCode = \"ifjh\";\nAndroidStreamable.getVideo(shortCode, new VideoCallback() {\n\t@Override\n\tpublic void onSuccess(int statusCode, Video video) {\n\t\t// :D\n\t}\n\t@Override\n\tpublic void onFailure(int statusCode, Throwable error) {\n\t\t// :(\n\t}\n});\n```\n\n### Retrieve a user\nReturns a [User](https://github.com/adrielcafe/AndroidStreamable/blob/master/androidstreamable/src/main/java/cafe/adriel/androidstreamable/model/User.java) object representing the requested user.\n```java\nString username = \"streamable\";\nAndroidStreamable.getUser(username, new UserCallback() {\n\t@Override\n\tpublic void onSuccess(int statusCode, User user) {\n\t\t// :D\n\t}\n\t@Override\n\tpublic void onFailure(int statusCode, Throwable error) {\n\t\t// :(\n\t}\n});\n```\n\n### Retrieve authenticated user\nReturns a [User](https://github.com/adrielcafe/AndroidStreamable/blob/master/androidstreamable/src/main/java/cafe/adriel/androidstreamable/model/User.java) object representing the currently authenticated user.\n```java\nAndroidStreamable.getAuthUser(new UserCallback() {\n\t@Override\n\tpublic void onSuccess(int statusCode, User user) {\n\t\t// :D\n\t}\n\t@Override\n\tpublic void onFailure(int statusCode, Throwable error) {\n\t\t// :(\n\t}\n});\n```\n\n## Video status\nWhen retrieve a video, you can check their status this way:\n```java\nswitch (video.getStatus()){\n\tcase AndroidStreamable.STATUS_VIDEO_IS_BEING_UPLOADED:\n\t\tbreak;\n\tcase AndroidStreamable.STATUS_VIDEO_IS_BEING_PROCESSED:\n\t\tbreak;\n\tcase AndroidStreamable.STATUS_VIDEO_HAS_AT_LEAST_ONE_FILE_READY:\n\t\tbreak;\n\tcase AndroidStreamable.STATUS_VIDEO_IS_UNAVAILABLE_DUE_TO_AN_ERROR:\n\t\tbreak;\n}\n```\n\n## Example\nCheck out the [app module](https://github.com/adrielcafe/AndroidStreamable/tree/master/app). Watch the **console log** to see this lib in action.\n\n## Import to your project\nPut this into your `app/build.gradle`:\n```\nrepositories {\n  maven {\n    url \"https://jitpack.io\"\n  }\n}\n\ndependencies {\n  compile 'com.github.adrielcafe:AndroidStreamable:0.5'\n}\n```\n\n## Dependencies\n* [Android Asynchronous Http Client](https://loopj.com/android-async-http/)\n\n## Official Streamable API documentation\nhttps://streamable.com/documentation\n\n## Tip: Playing videos\n[ExoMedia](https://github.com/brianwernick/ExoMedia) is *\"a utility class that wraps the [ExoPlayer](https://github.com/google/ExoPlayer) in to a standardized View and API much like the built in Android VideoView and MediaPlayer.\"*\n\n## Changelog\n### 0.5\n* Fix int conversion\n\n### 0.4\n* Replace `List\u003cVideoFile\u003e` by `Map\u003cString, VideoFile\u003e`, where String == video format\n* Fix exception when `json.getInt(\"status\")` == null\n* Add `http://` in url when starts with `//`\n\n### 0.3\n* Add `title` for uploaded and imported videos (new in official API)\n* Remove `Video.url_root` (no longer available by official API)\n* Remove `Video.formats` (no longer available by official API)\n\n### 0.2\n* Replace try catch by throws\n* Add `callback.onFailure()` on catches\n\n### 0.1\n* Supports authless and authenticated users\n* Supports all 5 official API methods: Get Video, Import Video, Upload Video, Get User, Get Authenticated User\n\n## License\n```\nThe MIT License (MIT)\n\nCopyright (c) 2015 Adriel Café\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrielcafe%2Fandroidstreamable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadrielcafe%2Fandroidstreamable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrielcafe%2Fandroidstreamable/lists"}