npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-onrewindsdk

v0.5.7

Published

react native wrapper for onrewind sdk

Downloads

321

Readme

react-native-onrewindsdk

react native wrapper for onrewind sdk

Installation

npm install react-native-onrewindsdk

You also need to install OnRewindSDK. For iOS:

  pod 'OnRewindSDK', :podspec => './specs/OnRewindSDK.podspec'
  pod 'onrewindshared', :podspec => './specs/onrewindshared.podspec'

# to download spec you can use the following script:

def download_spec! (options={})
  url = options[:url]
  FileUtils.mkdir_p './specs'
  Dir.chdir('./specs'){
    `curl -X GET '#{url}' -O -k -f -L`
  }
end

$onrewind_product_base_url='https://origins-mobile-products.s3.eu-west-1.amazonaws.com/onrewind_player/proximus/1.1.61'

download_spec!(url: "#{$onrewind_product_base_url}/OnRewindSDK.podspec")
download_spec!(url: "#{$onrewind_product_base_url}/onrewindshared.podspec")

For Android in Application class:

public class MainApplication extends Application implements ReactApplication {

   @Override
    public void onCreate() {
        super.onCreate();
        SoLoader.init(this, /* native exopackage */ false);

        OnRewind.initialize(new OnRewind.InitParams.Builder()
                .setApplicationContext(this)
                .setEnvironment(Environment.Production.INSTANCE)
                .build());
    }


     private final ReactNativeHost reactNativeHost =
            new DefaultReactNativeHost(this) {
              ....

              @Override
                protected List<ReactPackage> getPackages() {
                    @SuppressWarnings("UnnecessaryLocalVariable")
                    List<ReactPackage> packages = new PackageList(this).getPackages();
                    packages.add(new VideoPackage());
                    packages.add(new OnRewindPackage()); // Add this package to use onrewind overlay
                    return packages;
                } 

              .....
            }
}

in project level build gradle:

allprojects {
    repositories {
      ....
      maven {
            url "https://maven.pkg.github.com/netcosports/maven-packages"
            credentials {
                username project.ghUsername
                password project.ghPassword
            }
        }
    }
}

in module level build gradle:

implementation("com.origins-digital.onrewind:player-proximus:1.1.87") // put correct version

Usage

const OnRewindControls = requireNativeComponent('OnRewindControls');
const OnRewindPlayerModule = NativeModules.OnRewindPlayerModule;

// set account id

OnRewindPlayerModule.setAccountKey("SkH0O4D5H")


// add overlay

<OnRewindControls
  gameId="66992" // Put your game id here
  style={styles.controls}
  onPlaybackStateChanged={(event: NativeSyntheticEvent<String>) => {
    console.log("TEST: entered playbackStateChanged")
    let state = event.nativeEvent.playbackState;
    if (state === "play") {
      this.video?.play()
    } else if (state === "pause") {
      this.video?.pause()
    }
  }}
  onPlaybackSeekTo={(event: NativeSyntheticEvent<String>) => {
    let seekTo = event.nativeEvent.seekTo;
    this.video?.setPosition(seekTo)
  }}
>
</OnRewindControls>

// handle position and duration

OnRewindPlayerModule.updatePlayerPosition(position, duration, bufferedPercents)

// send video player state into onrewind sdk

switch (playbackState) {
  case PlayerState.Idle:
     OnRewindPlayerModule.updatePlayerState("idle")
    break;
  case PlayerState.Preparing:
     OnRewindPlayerModule.updatePlayerState("ready")
    break;
  case PlayerState.Buffering:
     OnRewindPlayerModule.updatePlayerState("loading")
    break;
  case PlayerState.Pausing:
     OnRewindPlayerModule.updatePlayerState("paused")
    break;
  case PlayerState.Playing:
     OnRewindPlayerModule.updatePlayerState("playing")
    break;
  case PlayerState.Finished:
     OnRewindPlayerModule.updatePlayerState("finished")
    break;
}

// if you have an error

OnRewindPlayerModule.setError(error.message)

// when your player has finished

OnRewindPlayerModule.seekCompleted()

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library