{"_id":"@busychild/nativescript-exoplayer","name":"@busychild/nativescript-exoplayer","dist-tags":{"latest":"6.0.3"},"versions":{"6.0.3":{"name":"@busychild/nativescript-exoplayer","version":"6.0.3","description":"NativeScript plugin that uses the ExoPlayer video player on Android and AVPlayerViewController on iOS to play local and remote videos.","main":"index","typings":"index.d.ts","nativescript":{"platforms":{"ios":"6.0.0","android":"6.0.0"}},"repository":{"type":"git","url":"git+https://github.com/nstudio/nativescript-plugins.git"},"keywords":["NativeScript","Android","iOS","TypeScript","video","video player","movie","exoplayer","subtitles"],"contributors":[{"name":"Nathanael Anderson","email":"nathan@master-technology.com","url":"https://github.com/nathanaela"},{"name":"Brad Martin","email":"bradmartin0905@gmail.com","url":"https://github.com/bradmartin"},{"name":"Alexander Ziskind","email":"alex@nuvious.com","url":"https://github.com/alexziskind1"},{"name":"Blake Nussey","email":"blake@stageme.com","url":"https://github.com/bnussey"},{"name":"Juan Manuel Campos Olvera","email":"juan4106@hotmail.com","url":"https://github.com/juanmcampos"},{"name":"Ivo Georgiev","email":"ivo@strem.io","url":"https://github.com/Ivshti"},{"name":"Alexander Semenov","email":"asemenovboyarka@gmail.com","url":"https://github.com/SemenovAlexander"},{"name":"Nathan Walker","email":"walkerrunpdx@gmail.com","url":"https://github.com/NathanWalker"},{"name":"NativeScript","email":"oss@nativescript.org"}],"author":{"name":"Nathanael Anderson","email":"nathan@master-technology.com","url":"https://github.com/nathanaela"},"bugs":{"url":"https://github.com/nstudio/nativescript-plugins/issues"},"license":"Apache-2.0","homepage":"https://github.com/nstudio/nativescript-plugins","bootstrapper":"@nativescript/plugin-seed","gitHead":"6fc9277fd1f5b9250c69e4b82059bd7189a3f092","_id":"@busychild/nativescript-exoplayer@6.0.3","_nodeVersion":"18.12.1","_npmVersion":"8.19.2","dist":{"integrity":"sha512-/uTvbYMnn7HBQvnwdplobJFHSJsoc1uonXyG0CDb+OmPDRpneMoj9DoCvlBythqh1ZLnuNXrL00wYtMzR8OqnA==","shasum":"bac4782302747e2bdcc71323ce56fdc6b0a7f52f","tarball":"https://registry.npmjs.org/@busychild/nativescript-exoplayer/-/nativescript-exoplayer-6.0.3.tgz","fileCount":26,"unpackedSize":2125147,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDYTF4yuOOFAmO4zuFaKRcORXF0BE1llzVCdQmHpA0WhwIhAMO10PglaJ8UfXSerW2UmABphoJVgjUbptIHx3l4Kk4m"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJju0LmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmohcBAAiTSwzt76eEGLjMlFFxLAFcptM/4jrHzRgOZl//51GlV2WjH/\r\nvk7+glfz/J9IJJWx8rGRhGSjYl+Ty8DxOoeI59SEYwqrgqIeG3j5N+39YyYX\r\nfhdv/E/42cmrE9m+H23TFbU51Ut9QQCFBbJ4eJrN0ciTOicv6bS30y3b2d7q\r\njnFVooL4zd9m9MqrVtNLNUDCzaPVp/7B8gDQGJp7F0LnVAkJ8sWSDbDfJkDb\r\nhJxG4/m/rATcKBYvFrISHHjDVb2iONmuz8v28MZyZ6iMFVJlDzGBUOQrrfzj\r\n2hTTC10qUByhAP53KZL5MyZpHhaJPoxvDzDW1/q/1cyd+RhCrcUzFf/m9cIG\r\n6AeXKqt83qFOu8QhljlsaHX5wm2CmVhGyHT5tOpMz5pxfYiwiEg2LzI3sBTU\r\nwslklPjqmqpMeYQ9kTi4uLHuVZ5YwEOe1Gf92g8M4m+l829XwdMFLsoK/Rcb\r\n7XTNHrpcfb0fydc8TAmaXMKCavSUeuqWubpFzcfFI+SlBDLq/yKubTavJ3qY\r\nmWBX1Yjz2eqdeVQcm8Xx0NP8nhy+qb2/CKj1VnLVHSQeuz5JKFQHdZv5gaAU\r\ne87h/HlbVuGrlrSeM+VWA2+uhwAT2mbYuIwM5R/IzAUXNHiM1VvQh4pwnMOD\r\nX9ere+CQc9VvlA8zO62/2+6lIRjCGUorGKA=\r\n=Wc2G\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"busychild","email":"busychild.mail@gmail.com"},"directories":{},"maintainers":[{"name":"busychild","email":"busychild.mail@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nativescript-exoplayer_6.0.3_1673216742689_0.010184631043389736"},"_hasShrinkwrap":false}},"time":{"created":"2023-01-08T22:25:42.617Z","6.0.3":"2023-01-08T22:25:42.922Z","modified":"2023-01-08T22:25:43.148Z"},"maintainers":[{"name":"busychild","email":"busychild.mail@gmail.com"}],"description":"NativeScript plugin that uses the ExoPlayer video player on Android and AVPlayerViewController on iOS to play local and remote videos.","homepage":"https://github.com/nstudio/nativescript-plugins","keywords":["NativeScript","Android","iOS","TypeScript","video","video player","movie","exoplayer","subtitles"],"repository":{"type":"git","url":"git+https://github.com/nstudio/nativescript-plugins.git"},"contributors":[{"name":"Nathanael Anderson","email":"nathan@master-technology.com","url":"https://github.com/nathanaela"},{"name":"Brad Martin","email":"bradmartin0905@gmail.com","url":"https://github.com/bradmartin"},{"name":"Alexander Ziskind","email":"alex@nuvious.com","url":"https://github.com/alexziskind1"},{"name":"Blake Nussey","email":"blake@stageme.com","url":"https://github.com/bnussey"},{"name":"Juan Manuel Campos Olvera","email":"juan4106@hotmail.com","url":"https://github.com/juanmcampos"},{"name":"Ivo Georgiev","email":"ivo@strem.io","url":"https://github.com/Ivshti"},{"name":"Alexander Semenov","email":"asemenovboyarka@gmail.com","url":"https://github.com/SemenovAlexander"},{"name":"Nathan Walker","email":"walkerrunpdx@gmail.com","url":"https://github.com/NathanWalker"},{"name":"NativeScript","email":"oss@nativescript.org"}],"author":{"name":"Nathanael Anderson","email":"nathan@master-technology.com","url":"https://github.com/nathanaela"},"bugs":{"url":"https://github.com/nstudio/nativescript-plugins/issues"},"license":"Apache-2.0","readme":"# @nstudio/nativescript-exoplayer\n\nNativeScript plugin that uses the ExoPlayer video player on Android and AVPlayerViewController on iOS to play local and remote videos.\n\n```javascript\nnpm install @nstudio/nativescript-exoplayer\n```\n\n## Platform controls used:\n\n| Android                                                 | iOS                                                                                                                               |\n| ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| [Google ExoPlayer](https://github.com/google/ExoPlayer) | [iOS AVPlayer](https://developer.apple.com/library/prerelease/ios/documentation/AVFoundation/Reference/AVPlayer_Class/index.html) |\n\nFor a 100% NativeScript plugin use the [NativeScript-VideoPlayer](https://github.com/bradmartin/nativescript-videoplayer).\n\n## Based on\n\nThis is based on the awesome [NativeScript-VideoPlayer](https://github.com/bradmartin/nativescript-videoplayer) by Brad Martin (nStudio, llc); the Android side was re-written to use Google's enhanced ExoPlayer. The iOS side is the same thing as what was in the original NativeScript-VideoPlayer.\n\nSince there is a lot of cases where you might still want a 100% NativeScript plugin, Brad and I decided to make this a separate plugin so that you can use the original NativeScript-VideoPlayer for those cases where you want a pure JavaScript plugin.\n\nThe Google ExoPlayer adds about a meg and a half plugin to the Android application.\n\n## Usage\n\n###\n\n```XML\n<Page xmlns=\"http://schemas.nativescript.org/tns.xsd\"\n      xmlns:exoplayer=\"@nstudio/nativescript-exoplayer\">\n        <StackLayout>\n\n            <exoplayer:Video id=\"nativeexoplayer\"\n            controls=\"true\" finished=\"{{ videoFinished }}\"\n            loop=\"true\" autoplay=\"false\" height=\"280\"\n            src=\"~/videos/big_buck_bunny.mp4\" />\n\n            <!-- Remote file to test with https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4 -->\n\n        </StackLayout>\n</Page>\n```\n\n## NativeScript Angular Usage\n\n```TS\n// somewhere at top of your component or bootstrap file\nimport { registerElement } from \"@nativescript/angular\";\nimport { Video } from '@nstudio/nativescript-exoplayer';\nregisterElement(\"Video\", () => Video);\n```\n\n```XML\n  <Video\n      src=\"https://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4\"\n      autoplay=\"true\"\n      height=\"300\"></Video>\n```\n\n## Properties\n\n- **src** - _required_\n\nSet the video file to play, for best performance use local video files if possible. The file must adhere to the platforms accepted video formats. For reference check the platform specs on playing videos.\n\n- **srcType** - (Android Only)\n\n* 0 = DETECT (from src)\n* 1 = SS\n* 2 = DASH\n* 3 = HLS\n* 4 = OTHER\n\n- **enableSubtitles**\n\nBy default, subtitle support is off. Use this flag to turn them on.\n\n- **subtitles**\n\nSet `.srt` file with subtitles for given video. This can be local file or internet url. Currently only `.srt` format is supported.\n\n- **autoplay - (boolean)** - _optional_\n\nSet if the video should start playing as soon as possible or to wait for user interaction.\n\n- **finished - (function)** - _optional_\n\nAttribute to specify an event callback to execute when the video reaches the end of its duration.\n\n- **controls - (boolean)** - _optional_\n\nSet to use the native video player's media playback controls.\n\n- **muted - (boolean)** - _optional_\n\nMutes the native video player.\n\n- **loop - (boolean)** - _optional_\n\nSets the native video player to loop once playback has finished.\n\n- **backgroundAudio - (boolean)** - _optional_\n\nIf set to true, the audio for the video won't pause any existing audio playing. Instead it will play simultaneously with the existing audio. This is similar to how instagram and facebook play their video audio.\n\n- **fill - (VideoFill)** - _optional_\n\nAndroid: When set to VideoFill.aspectFill, the aspect ratio of the video will not be honored and it will fill the entire space available.\n\niOS:\n\n- VideoFill.default = AVLayerVideoGravityResize\n- VideoFill.aspect = AVLayerVideoGravityResizeAspect\n- VideoFill.aspectFill = AVLayerVideoGravityResizeAspectFill\n\nSee [here for explanation](https://developer.apple.com/documentation/avfoundation/avlayervideogravity).\n\n- **playbackReady - (function)** - _optional_\n\nAttribute to specify an event callback to execute when the video is ready to play.\n\n- **seekToTimeComplete - (function)** - _optional_\n\nAttribute to specify an event callback to execute when the video has finished seekToTime.\n\n- **observeCurrentTime - (boolean)** - _optional_\n\nIf set to true, currentTimeUpdated callback is possible.\n\n- **currentTimeUpdated - (function)** - _optional_\n\nAttribute to specify an event callback to execute when the time is updated.\n\n## API\n\n- **play()** - Start playing the video\n- **pause()** - Pause the video\n- **seekToTime(time: number)** - Seek the video to a time (milliseconds)\n- **getCurrentTime()** - Returns the current time in the video duration (milliseconds)\n- **getDuration()** - Returns the duration of the video (milliseconds)\n- **destroy()** - Destroy the video player and free resources\n- **mute(boolean)** - Mute the current video\n- **setVolume()** - Set the volume - Must be between 0 and 1.\n\n### Android only\n\n- **stop()** - Stop the playback - this resets the player and remove the video src\n\n## Breaking Changes\n\n- Android will now attach/detach to the application suspend/resume and de-register/re-register video\n- Subtitle support will by default be disabled.\n\n## ExoPlayer Encryption (Android only)\n\n### Create a key based on the password \"secret\", outputs salt, key, and iv... (You can redirect to a file if you want)\n\n- openssl enc -aes-256-ctr -k secret -P --nosalt\n  Will output because we aren't using a salt:\n\n```\nkey=2BB80D537B1DA3E38BD30361AA855686BDE0EACD7162FEF6A25FE97BF527A25B\niv =015E42FF678B2B90B743111A396EF850\n```\n\nNormally you would not want to add the `--nosalt`, but to make this easier to follow as the key & iv will be the same with --nosalt\nWhich would then give you output **like** this, but every difference in salt you get a different key/iv:\n\n```\nsalt=42D57450DAF116BD\nkey=E8E82C95A1A4FEFE5334578678CAD5699091D34322FDD5811A786BE82961DD00\niv =ED07304DF8D0D0AFA2EB9B13D75BD817\n```\n\n### Create the Encrypted video file\n\n- openssl enc --nosalt -aes-256-ctr -in small.mp4 -out video.enc -K 2BB80D537B1DA3E38BD30361AA855686BDE0EACD7162FEF6A25FE97BF527A25B -iv 015E42FF678B2B90B743111A396EF850\n- - you can use `-S <your_salt_value>` to set the salt value instead of `--nosalt`\n\n### Contributors\n\n- Alex Semenov\n- Alex Ziskind [@digitalix](https://twitter.com/digitalix)\n- Blake Nussey\n- Brad Martin [@BradWayneMartin](https://twitter.com/BradWayneMartin)\n- Jibon Lawrence Costa\n- Nathanael Anderson [@CongoCart](https://twitter.com/CongoCart)\n- Nathan Walker [@wwwalkerrun](https://twitter.com/wwwalkerrun)\n- Osie Fortune\n- Alex Gritton\n- gaudsonu98\n\n## License\n\nApache License Version 2.0\n","readmeFilename":"README.md"}