{"id":24113696,"url":"https://github.com/frontyard/cordova-plugin-exoplayer","last_synced_at":"2025-05-01T09:55:19.789Z","repository":{"id":17600440,"uuid":"82323020","full_name":"frontyard/cordova-plugin-exoplayer","owner":"frontyard","description":"Media player plugin for Cordova that uses Google's ExoPlayer","archived":false,"fork":false,"pushed_at":"2025-04-02T13:18:23.000Z","size":438,"stargazers_count":55,"open_issues_count":2,"forks_count":71,"subscribers_count":7,"default_branch":"2.0.0","last_synced_at":"2025-04-02T14:26:37.040Z","etag":null,"topics":["android","cordova","exoplayer","ionic","media","phonegap","plugin","video"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frontyard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2017-02-17T17:47:34.000Z","updated_at":"2025-04-02T13:18:26.000Z","dependencies_parsed_at":"2022-07-26T19:02:04.043Z","dependency_job_id":"53d381ae-5c2d-4059-ac54-00d762689232","html_url":"https://github.com/frontyard/cordova-plugin-exoplayer","commit_stats":{"total_commits":84,"total_committers":6,"mean_commits":14.0,"dds":"0.19047619047619047","last_synced_commit":"1b4e608a4b927da00f6b5293e17381ab8bd54154"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frontyard%2Fcordova-plugin-exoplayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frontyard%2Fcordova-plugin-exoplayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frontyard%2Fcordova-plugin-exoplayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frontyard%2Fcordova-plugin-exoplayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frontyard","download_url":"https://codeload.github.com/frontyard/cordova-plugin-exoplayer/tar.gz/refs/heads/2.0.0","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251856993,"owners_count":21655119,"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","cordova","exoplayer","ionic","media","phonegap","plugin","video"],"created_at":"2025-01-11T04:24:33.669Z","updated_at":"2025-05-01T09:55:19.782Z","avatar_url":"https://github.com/frontyard.png","language":"Java","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=2ZPEB7VKFG2CY"],"categories":[],"sub_categories":[],"readme":"[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE) [![Build Status](https://travis-ci.org/frontyard/cordova-plugin-exoplayer.svg?branch=2.0.0)](https://travis-ci.org/frontyard/cordova-plugin-exoplayer) [![Code Climate](https://codeclimate.com/github/frontyard/cordova-plugin-exoplayer/badges/gpa.svg)](https://codeclimate.com/github/frontyard/cordova-plugin-exoplayer) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=2ZPEB7VKFG2CY)\n\n## THIS PLUGIN IS NO LONGER MAINTAINED, I suggest you find a fork that is still being worked on or create a fork of your own! Thank you for your support 🫶\n\n# Cordova ExoPlayer Plugin\n\nCordova media player plugin using Google's ExoPlayer framework.\n\nPlease send us links to your cool projects made with this plugin so we can include them on this page!\n\n## Keeping track of exoplayer versions here:\n|plugin|exoplayer|\n|-----|---------|\n|2.6.0|2.18.1|\n|2.5.7|2.18.1|\n|2.5.6|2.9.6|\n|2.5.5|2.8.1|\n|2.5.4|2.6.1|\n\n## Changes in version 2.6.0\nAdd alternative constructor to allow creation of player without Android UI\n - New feature, hence change in package minor version\nFix crash at playback start\n\n## Changes in version 2.5.7\nUpgrade exoplayer to 2.18.1\nMerge changes from  netmikey fork\n- Various updates needed to remove `SimpleExoPlayer`\n\n## Changin in version 2.5.6\nUpgraded exoplayer to 2.9.6\n\nUpgrading to following versions is now possible\ncordova: 11.0.0 (latest)\ncordova-android: ^9.1.0\n\n## Changes in version 2.5.4\n- Added loading progress bar to the top that shows up when player is buffering. This needs to be explicitly turned on with `showBuffering` boolean configuration setting.\n- Added ability to change text, buttons and buffering colors using new controller configuration settings `textColor`, `buttonsColor` and `bufferingColor`.\n- Added positionInFirstPeriod to TIMELINE_EVENT.\n- Upgraded exoplayer to 2.6.1.\n\n## Changes in version 2.5.3\n- After observing performance issues removing the usage of okhttp.\n- Removing the 'android.hardware.touchscreen' check before adding touch handler. This feature is not reliably reported by various devices.\n\n## Changes in version 2.5.2\n- Upgraded exoplayer to version 2.5.1\n- Only adding touchscreen event handler if device has \"android.hardware.touchscreen\" system feature.\n- Added `connectTimeout`, `readTimeout` and `retryCount` configuration settings. These are related to http client player uses.\n- Added `seekBy` which is simmilar to seekTo but operates relative to the current possition. Value can be positive (seek forward) or negative (seek backwards).\n\n## Changes in version 2.5.1\n- Added boolean options `hidePosition` and `hideDuration`. When playing dvr content thise numbers are relative to current time and very confusing to users. Adding ability to hide the numbers until better solution can be found.\n- Added `autoPlay` (defaults to true) to allow user not to play the stream automatically. Must call `play` explicitly.\n\n## Changes in version 2.5.0\n- Removed configuration setting `skipTime` and replaced it with separate `forwardTime` and `rewindTime`.\n- Sending `TIMELINE_EVENT` to Cordova with `periodDurationX` and `periodWindowPositionX` properties for duration and window position for each period (marked X) in the stream.\n\n## Changes in version 2.4.5\n- Added `setController` method to update the controller mid-stream. It accepts the same controller object that is used as part of parameters for `show` method.\n\n## Changes in version 2.4.4\n- Added `stop` method to fully stop the stream but not realease the player. Call `setStream` to restart the playback or `close` to dispose of it.\n\n## Changes in version 2.4.2\n- Plugin no longer acts on audio focus event but rather let's Cordova app decide what to do.\n\n## Changes in version 2.4.1\n- When audio focus changes, plugin will send `AUDIO_FOCUS_EVENT` with parameter `audioFocus` that can be on of:\n `AUDIOFOCUS_LOSS_TRANSIENT`, `AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK`, `AUDIOFOCUS_GAIN`, `AUDIOFOCUS_LOSS`.\n\n## Changes in version 2.4.0\n- Controller will no longer show automatically on touch and key events.\n- Added showController and hideController methods for explicit control of controller visibility.\n- Plugin will not longer close on KEYCODE_BACK key event, please call .close() explicitly.\n- Plugin will request audio focus on startup. It will also listen for audio focus events and pause/play on those events. It will close on AUDIOFOCUS_LOSS.\n- START_EVENT will return additional info `audioFocus` which can be AUDIOFOCUS_REQUEST_FAILED or AUDIOFOCUS_REQUEST_GRANTED.\n- STATE_EVENT will return additional info `controllerVisible` to tell the app if controller is visible or not.\n\n## Changes in version 2.3.0\n\n- Renamed plugin's namespace from window.exoplayer to window.ExoPlayer\n- Removed `init` method as there is no need to keep instance of the plugin around. Just call methods directly on window.ExoPlayer\n- `show` now takes configuration parameters as the first argumeent since we don't need init any more.\n- Renamed `playOffset` configuration setting to `seekTo` to match the coresponding method that does the same thing\n- Replaced `play` and `pause` methods with single `playPause` that does both and keeps track of playback status\n\n## Using\n\nCreate a new Cordova Project\n\n    $ cordova create hello com.example.helloapp Hello\n\nInstall the plugin\n\n    $ cd hello\n    $ cordova plugin add cordova-plugin-exoplayer\n\n\nEdit `www/js/index.js` and add the following code inside `onDeviceReady`\n\n```js\n    var successCallback = function(json) {\n    };\n\n    var errorCallback = function(error) {\n    };\n\n    var params = {\n        url: \"http://www.youtube.com/api/manifest/dash/id/bf5bb2419360daf1/source/youtube?as=fmp4_audio_clear,fmp4_sd_hd_clear\u0026sparams=ip,ipbits,expire,source,id,as\u0026ip=0.0.0.0\u0026ipbits=0\u0026expire=19000000000\u0026signature=51AF5F39AB0CEC3E5497CD9C900EBFEAECCCB5C7.8506521BFC350652163895D4C26DEE124209AA9E\u0026key=ik0\"\n    };\n\n    window.ExoPlayer.show(parameters, successCallback, errorCallback);\n```\n\nPlugin methods exported via window.ExoPlayer\n```js\n{\n    setStream(url, controllerConfig) // switch stream without disposing of the player. controllerConfig is \"controller\" part of the inital parameters.\n    playPause() // will pause if playing and play if paused :-)\n    stop() // will stop the current stream\n    seekTo(milliseconds) // jump to particular poing into the stream\n    getState(successCallback, errorCallback) // returns player state\n    showController() // shows player controller\n    hideController() // hides player controller\n    setController() // sets `controller` part of configuration related to the info bar and control buttons.\n    close() // close and dispose of player, very important to call this method when your app exits!\n}\n```\n\nThis is what `parameters` look like for the `show` call, most of them are optional:\n```js\n{\n    url: 'https://devimages.apple.com.edgekey.net/streaming/examples/bipbop_4x3/bipbop_4x3_variant.m3u8',\n    userAgent: 'MyAwesomePlayer', // default is 'ExoPlayerPlugin'\n    aspectRatio: 'FILL_SCREEN', // default is FIT_SCREEN\n    hideTimeout: 5000, // Hide controls after this many milliseconds, default is 5 sec\n    autoPlay: true, // When set to false stream will not automatically start\n    seekTo: 10 * 60 * 60 * 1000, // Start playback 10 minutes into video specified in ms, default is 0\n    forwardTime: 60 * 1000, // Amount of time in ms to use when skipping forward, default is 1 min\n    rewindTime: 60 * 1000, // Amount of time in ms to use when skipping backward, default is 1 min\n    audioOnly: true, // Only play audio in the backgroud, default is false\n    subtitleUrl: 'http://url.to/subtitle.srt', // Optional subtitle url\n    connectTimeout: 1000, // http connect timeout in ms (default is 0)\n    readTimeout: 1000, // http read timeout in ms (default is 0)\n    retryCount: 5, // Number of times datasource will retry the stream before giving up (default is 3)\n    showBuffering: true, // When buffering, player will show indicator at the top of the screen, default is false\n    controller: { // If this object is not present controller will not be visible\n        streamImage: 'http://url.to/channel.png',\n        streamTitle: 'Cool channel / movie',\n        streamDescription: '2nd line you can use to display whatever you want like current program epg or movie description',\n        hideProgress: true, // Hide entire progress timebar\n        hidePosition: false, // If timebar is visible hide current position from it\n        hideDuration: false, // If timebar is visible Hide stream duration from it\n        controlIcons: {\n            'exo_rew': null, // Set to null to remove the button from the player\n            'exo_play': 'http://url.to/play.png',\n            'exo_pause': 'http://url.to/pause.png',\n            //'exo_ffwd': null, // Buttons not included in configuration will show up as default ExoPlayer buttons\n        },\n        textColor: '#ffff0000', // These colors can be any valid Android color\n        buttonsColor: '#ff00ff00', // This example uses hex values including alpha (first byte)\n        bufferingColor: '#ff0000ff' // Alpha of 'ff' makes it 100% opaque\n    }\n}\n```\nController is composed of several pieces. To the left there is optional streamImage, followed by two lines on the right, top and bottom. Top line is reserved for streamTitle, while bottom line can either be streamDescription or progress bar. If you provide streamDescription, progress bar will not be visible. Optionaly you can turn off progress bar by passing hideProgress: true if you don't want to show either.\n\nPlayback control buttons are centered on the screen and use default ExoPlayer icons. Optionally you can override these by your own images via controlIcons object.\n\nYou can pass `subtitleUrl` for subtitle to be shown over the video. We currently support .srt and .vtt subtitle formats. Subtitles are not supported on all stream types, as ExoPlayer has requirement that both video and subtitle \"must have the same number of periods, and must not have any dynamic windows\", which means for simple mp4s it should work, but on more complex HLS/Dash setups it might not.\n\nIf you pass in `audioOnly: true`, make sure to manually close the player on some event (like escape button) since the plugin won't be detecting keypresses when playing audio in the background.\n\nIf you want to show default control buttons (play/pause, rewind, forward) you need an empty controlIncons object:\n```js\n    controlIcons: {\n    }\n```\n\nPlugin will send following events back to Cordova app through successCallback specified through show function:\n```js\nSTART_EVENT\nSTOP_EVENT\nKEY_EVENT\nTOUCH_EVENT\nLOADING_EVENT\nSTATE_CHANGED_EVENT\nPOSITION_DISCONTINUITY_EVENT\nSEEK_EVENT\nPLAYER_ERROR_EVENT\nTIMELINE_EVENT\n```\nEach event will send JSON payload coresponding to that event. Some events (where appropriate) will also send additional information about playback like duration, postion, etc.\n\nExample of key events:\n```js\n{\n    'eventType':'KEY_EVENT',\n    'eventAction':'ACTION_DOWN',\n    'eventKeycode':'KEYCODE_VOLUME_UP'\n}\n\n{\n    'eventType':'KEY_EVENT',\n    'eventAction':'ACTION_UP',\n    'eventKeycode':'KEYCODE_VOLUME_UP'\n}\n```\n\n\nExample of touch events:\n```js\n{\n    'eventType':'TOUCH_EVENT',\n    'eventAction':'ACTION_DOWN',\n    'eventAxisX':543,\n    'eventAxisY':1321.8009033203125\n}\n\n{\n    'eventType':'TOUCH_EVENT',\n    'eventAction':'ACTION_MOVE',\n    'eventAxisX':543,\n    'eventAxisY':1320.5\n}\n\n{\n    'eventType':'TOUCH_EVENT',\n    'eventAction':'ACTION_UP',\n    'eventAxisX':543,\n    'eventAxisY':1320.5\n}\n```\n\nInstall Android platform\n\n    cordova platform add android\n\nRun the code\n\n    cordova run\n\n## IONIC\n\nFor examples of using this plugin in an [IONIC](https://ionicframework.com/) app please see [this thread](https://github.com/frontyard/cordova-plugin-exoplayer/issues/4).\n\nFor IONIC Native see [npm module](https://www.npmjs.com/package/@ionic-native/android-exoplayer).\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch off of current upstram branch (currently 2.0.0)\n3. Commit and push your changes to that branch\n4. Create new Pull Request\n\n## More Info\n\nFor more information on setting up Cordova see [the documentation](http://cordova.apache.org/docs/en/latest/guide/cli/index.html)\n\nFor more info on plugins see the [Plugin Development Guide](http://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/index.html)\n\nGeneral ExoPlayer [documentation](https://google.github.io/ExoPlayer/)\n\nExoPlayer [source code](https://github.com/google/ExoPlayer)\nhttps://github.com/frontyard/cordova-plugin-exoplayer\n\n## Donation\nIf this project helps you consider donating to support it!\n\n[![paypal](https://cdn.rawgit.com/twolfson/paypal-github-button/1.0.0/dist/button.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=2ZPEB7VKFG2CY)\n\n## License\n\n The MIT License (MIT)\n\n Copyright (c) 2017-2018 Nedim Cholich\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in all\n copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrontyard%2Fcordova-plugin-exoplayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrontyard%2Fcordova-plugin-exoplayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrontyard%2Fcordova-plugin-exoplayer/lists"}