chaimpaneth / react-native-jw-media-player Goto Github PK
View Code? Open in Web Editor NEWReact-Native Android/iOS bridge for JWPlayer SDK (https://www.jwplayer.com/)
License: MIT License
React-Native Android/iOS bridge for JWPlayer SDK (https://www.jwplayer.com/)
License: MIT License
Hi.
When I run the example on the Android, I get the following error:
Building and installing the app on the device (cd android && ./gradlew installDebug)...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> failed to find Build Tools revision 23.0.1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 2.648 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
(node:25034) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'message' of undefined
at handleError (/home/ppc/React/Native/react-native-jw-media-player/Example/node_modules/react-native/local-cli/cliEntry.js:35:21)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
(node:25034) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:25034) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
He also complains about sdk.dir=/path/to/AndroidSDK
. the latter is solved by adding a file local.properties:
sdk.dir=/path/to/AndroidSDK
Hi there, I couldn't find any documentation about closed captioning support.
Does the mediaId
property allow the player to read the captions available?
Any assistance on this topic would be appreciated, thank you.
Hi @chaimPaneth, I am trying to implement VMAP ads on JWPlayer by adding adSchedule on playlistItem
. But I always get the result that the ad's video does not play and also there is always a loading indicator run forever while the original video won't play. I need your help. Thank you.
This is an example of my playlist item
const playlistItem = {
mediaID: "ykJZQsJn",
time: 0,
file: "https://cdn.jwplayer.com/manifests/ykJZQsJn.m3u8",
controls: true,
repeat: false,
adSchedule: [
{
tag:
'https://pubads.g.doubleclick.net/gampad/ads?slotname=/124319096/external/ad_rule_samples&sz=640x480&ciu_szs=300x250&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpost&url=https://developers.google.com/interactive-media-ads/docs/sdks/html5/tags&unviewed_position_start=1&output=xml_vast3&impl=s&env=vp&gdfp_req=1&ad_rule=0&vad_type=linear&vpos=preroll&pod=1&ppos=1&lip=true&min_ad_duration=0&max_ad_duration=30000&vrid=6256&video_doc_id=short_onecue&cmsid=496&kfa=0&tfcd=0',
offset: 'pre',
},
],
That case only happens on Android but fine on iOS. ๐
I think this is the same issue:
TheWidlarzGroup/react-native-video#1319
Look absolutely the same.
Is it fixible?
When the media player is in full screen and React Native deep-linking navigation occurs, the fullscreen video is not removed from the view and the controls go missing.
I received some reports that audio stops on iOS 14 version when app is in background
When I run app with this code, i see black dot at 10s in seek bar but when the video runs to the black dot, my Ads not running.
And this is link VAST xml file:
https://xxxxxx/vast/?zone=24
Thanks for reading my issue, sorry because my English is bad.
onSeek & onSeeked event callbacks on iOS is not working. Would love to implement it myself but at this moment my objective c skills are not enough :/
Hi @chaimPaneth , it seems that using the adVmap prop as described in the docs does not work neither on iOS nor Android. The vmap url is passed into native code but it seems the player is ignoring it for some reason. It works in the iOS demo app provided by JW Player.
Here's some example code (taken from the example):
<JWPlayer
style={styles.player}
playlistItem={{
mediaId: "1",
file: "http://content.bitsontherun.com/videos/3XnJSIm4-injeKYZS.mp4",
autostart: false,
adVmap: "http://playertest.longtailvideo.com/adtags/vmap2.xml"
}}
onBeforePlay={() => this.onBeforePlay()}
onPlay={() => this.onPlay()}
onSetupPlayerError={(e) => this.onSetupPlayerError(e)}
onPlayerError={(e) => this.onPlayerError(e)}
onBuffer={() => this.onBuffer()}
onTime={(time) => this.onTime(time)}
nativeFullScreen={true}
onFullScreen={() => this.onFullScreen()}
onFullScreenExit={() => this.onFullScreenExit()}
/>
If you could point me to what the problem might be, it would be much appreciated.
Thank you.
Build input file cannot be found: '../node_modules/react-native-jw-media-player/ios/CustomJWPlaylistItem.m'
JWPlayer Android SDK 3.16.0 Release Notes:
Updated the Google IMA to support version 3.18.1.
This has caused some sort of incompatibility between google packages. It wasn't able to find androidx.media.session.
Downgrading to 3.15.1 fixed the issue.
I tried adding css file on the android assets
folder, but it has no effect. I see the implementation is looking up to the String.format(file:///android_asset/%s.css, name)
. To no effect.
I did some research and it said that JWPlayer has no support for local css file,
[1] https://jwplayer-support-archive.netlify.com/questions/17033726-player-config-cssskin-local-file
We are using background audio on a page which has multiple videos.
When we play a video, we are able to see the background audio control in the notification center(NC) but when we click pause from the NC, it controls the last video on the page(not the video being played).
Please tell me if there is support for video ads? If so, can you show some code examples?
Hi @chaimPaneth ,
I have a url with extension .m3u8 (no video, it is black screen), and i want display image by 'image' prop in playListItem when my video url black screen. Android done, but iOS not working...
Can you tell me how to do it? :((
Thank you!
When rendering multiple videos on a single page, the iOS app crashes.
Thread 1: EXC_BAD_ACCESS (code=1, address=0x222dfde48)
RN version: 0.59.4
JWPlayer: 3.7.0
react-native-jw-media-player: 0.1.12
Does this package work with react-native >= 0.60?
Currently, background audio for android is hardcoded as in this code.
I tried hardcoding it as:
mPlayer.setBackgroundAudio(false);
But it is not working. Let's investigate whether it is JWPlayer's SDK fault or there is something more to be added for this package
Does this library support background playback for audio?
I get youtube link download from youtube
I have checked the path in my browser and it works
Link be like
https://r3---sn-42u-i2i6.googlevideo.com/videoplayback?expire=1581370303&ei=X3dBXsOBA4mR4AL7kqnIBA&ip=150.95.114.172&id=o-AB4f5tYq_JBvnsi6hIUva2jS1sYN6S00h9Lz35NgPf7J&itag=18&source=youtube&requiressl=yes&mm=31%2C29&mn=sn-42u-i2i6%2Csn-42u-nbo6&ms=au%2Crdu&mv=u&mvi=2&pl=21&vprv=1&mime=video%2Fmp4&gir=yes&clen=14781074&ratebypass=yes&dur=315.628&lmt=1580882523007800&mt=1581348373&fvip=3&fexp=23842630&c=WEB&txp=5531432&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cratebypass%2Cdur%2Clmt&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl&lsig=AHylml4wRAIgEXAiDymwQB4FzEQw2S21Snoa_Rw0kAoyKPtyxdpGTqQCIFAi2g3g75qShheNnuua2l3Qk_80NBQqx7ueQ2gSoDRY&sig=ALgxI2wwRQIhAIXrrCRXTbIZmsO8ZKRVtP8M3G9mewIBXOn6W4Yu94sEAiBIbXJPJjyLz-mNT32qtz74rkxrPoBwCm1AJbgZ6oQ3VQ==
@chaimPaneth before starting, thanks a lot for your library! We are currently using it in our team, and your work helped us a lot!
Since we are using Typescript, we added a basic typescript definition in our project but I've figured that I could spend more time to make it exhaustive and open a PR here. Are you encline to have and maintain typescript definition in this repo ? As I said I can open a PR to add typescript definitions for the current API.
Cheers!
From crashlytics. Latest version 2020-02-02
Fatal Exception: java.lang.IllegalArgumentException
Service not registered: com.appgoalz.rnjwplayer.RNJWPlayerView$1@7843d02
android.app.LoadedApk.forgetServiceDispatcher (LoadedApk.java:1344)
android.content.ContextWrapper.unbindService (ContextWrapper.java:655)
CRASH >>> com.appgoalz.rnjwplayer.RNJWPlayerView.doUnbindService (RNJWPlayerView.java:625)
I tried remove button rewind 10 seconds by change skin JWP but look like prop playerStyle doesn't work, or native not receive css file. ๐ญ
I made a playlist with playlistItems and in iOS worked, Android don't.
Am i missing something? Or it's a feature to add in the feature?
import React, { Component } from 'react';
import {
StyleSheet,
View,
} from 'react-native';
import JWPlayer from 'react-native-jw-media-player';
const styles = StyleSheet.create({
container: {
flex: 1,
},
player: {
width:"100%",
height:250
},
});
export default class App extends Component {
componentDidMount(){
console.log(JWPlayer);
}
onBeforePlay() { // eslint-disable-line
// console.log('onBeforePlay was called');
}
onPlay() { // eslint-disable-line
// console.log('onPlay was called');
}
onPlayerError(error) { // eslint-disable-line
// console.log('onPlayerError was called with error: ', error);
}
onBuffer() { // eslint-disable-line
// console.log('onBuffer was called');
}
onTime({ position, duration }) { // eslint-disable-line
// console.log('onTime was called with: ', position, duration);
}
render() {
return (
<JWPlayer
style={styles.player}
autostart={true}
file={'http://cn7.kankia.com/hls/20200107/0381bd7aa19679e00989a253172bd7e1/1578381712/index.m3u8'}
onBeforePlay={() => this.onBeforePlay()}
onPlay={() => this.onPlay()}
controls={true}
onPlayerError={e => this.onPlayerError(e)}
onBuffer={() => this.onBuffer()}
onTime={time => this.onTime(time)}
/>
);
}
}
JW player provides casting in the native library. But I don't see any method to access it. Please help.
Platform: Android
When user navigates back from video screen. It keeps playing in background. Also when another video opens during that time app crashes. I also tried unmounting view video is still playing...
Latest version used
0.1.40
On android going into full screen mode video is black screen. Audio still playing normally. After seeking into other time or pressing settings & back video is shown again. Sometimes same thing replicated on going back out of full screen.
EDIT: play/pause also helps
Hi after upgrading to a newest version 0.1.49 and adding everything required by casting I receive this email from apple:
...The app's Info.plist file should contain a NSMicrophoneUsageDescription key with a user-facing purpose string...
Should this be mentioned in readme ?
And why does it need a microphone usage?
Is there plans for Chromecast support on android?
I am implementing JWPlayer on my RN app.
It's working well but unfortunately, seems it is not supported for chromecast.
If someone knows that, I am appreciate.
Thanks
Hello, I don't see any easy way to see what's changed between versions. Can you let me know if I've missed that somewhere? Otherwise I do recommend keeping a CHANGELOG.md or tagging your releases on Github w/ accompanying documentation. Appreciate your work!
Executing the example project gives an error in iOS:
Ordered comparison between pointer and zero ('NSNumber *' and 'int')
In line 32 of file RCJavaScriptLoader.mm
Android is not working too...
TypeError: Cannot read property 'message' of undefined
at handleError (/Users/.../Documents/Demos/react-native-jw-media-player-master/Example/node_modules/react-native/local-cli/cliEntry.js:35:21)
Hii, I am not able to run my project in xcode.
error: Build input file cannot be found: '/Users/user/WorkSpace/git/slp/node_modules/react-native-jw-media-player/ios/CustomJWPlaylistItem.m' (in target 'RNJWPlayer' from project 'RNJWPlayer')
Seems like CustomJWPlaylistItem.m file is missing. I have tried to run pod install. Link and relink the library multiple times but it didn't work.
Project dependencies:
"react-native-jw-media-player": "0.1.32",
"react": "^16.8.3",
"react-native": "^0.59.10"
Gettings errors for android:
ERROR: Failed to resolve: com.longtailvideo.jwplayer:jwplayer-core:+
ERROR: Failed to resolve: com.longtailvideo.jwplayer:jwplayer-common:+
I added:
maven {
url 'https://mvn.jwplayer.com/content/repositories/releases/'
}
In projects .gradle file. Still nothing. How to fix this?
#import "React/RCTViewManager.h" not found
When clicking on the fullscreen button, the app changes orientation but does not take over the display. It appears that the player goes into fullscreen of the container that it is in, rather than taking over the screen.
We invoke the player using
const playlistItem = { file: 'sample.com', mediaId: 'sample', autostart: false }
<JWPlayer
playlistItem={playlistItem}
style={styles.player}
onBeforePlay={() => this.printSomething("onBeforePlay", null)}
onPlay={() => this.printSomething("onPlay", null)}
onPause={() => this.printSomething("onPause", null)}
onIdle={() => this.printSomething("onIdle", null)}
onPlaylistItem={event => this.printSomething("onPlaylistItem", event)}
onSetupPlayerError={event => this.printSomething("onSetupPlayerError",event)}
onPlayerError={event => this.printSomething("onPlayerError", event)}
onBuffer={() => this.printSomething("onBuffer", null)}
onFullScreen={() => this.onFullScreen()}
onPlayerReady={() => this.onPlayerReady()}
onFullScreenExit={() => this.onFullScreenExit()}
/>
RN version: 0.57.4
JWPlayer: 3.7.0
react-native-jw-media-player: 0.1.12
When installing the library, the android aar files generated is outdated and references old code.
Version 0.1.23
Build input file cannot be found: '../node_modules/react-native-jw-media-player/ios/CustomJWPlaylistItem.m'
This file is not currently in this repo, however, when I checkout the forks on this repo, it is present. Why was this file removed?
Hey there! It looks like playlist.stereomode
isn't included in the playlist/playlist item props so that one can "look around" whilst viewing a 360 video.
Please, could this support be added for this?
Requesting few more callbacks:
onComplete
- when media has reached the ending.
onSeek
- when seek was requested from default controls.
Isn't onIdle
the same as my requested onComplete
? If so it does not work android.
Also onTime
callback does not return described parameters (checked android).
Hi. Is there any way we could control the volume or mute?
Thanks
On latest version on Android callback onFullScreenExit
is not called.
When exiting fullscreen onFullScreen
is called instead onFullScreenExit
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.