Ziggeo / ReactNativeSDK

React Native SDK
Apache License 2.0
7 stars 6 forks source link

Instructions on how to use ReactNativeSDK iOS Player #5

Closed dancomanlive closed 6 years ago

dancomanlive commented 7 years ago

iOS ZiggeoPlayer

  1. npm install ... and react-native-link... as written in the readme file

  2. go here https://github.com/Ziggeo/iOS-Client-SDK and Clone or Download

  3. in the unzipped folder go to Ziggeo/Output/Release-universal/Ziggeo.framework

  4. drag and drop Ziggeo.framework in xCode Frameworks folder

  5. Make sure Ziggeo.framework is added to Embedded Binaries and Linked Framework sections in your app target settings

    6 in Build Phases go to Bundle React Native code and images: shell: /bin/sh export NODE_BINARY=node ../node_modules/react-native/scripts/react-native-xcode.sh check Show environment variables including build log

  6. add #import "Ziggeo/Ziggeo.h" to AppDelegate.m

  7. signup for an account, upload a video and get the token from Video Data

    9 video player screen code:

import React, { Component } from 'react';
import {
  View,
  Text,
  StyleSheet,
} from 'react-native';
import Ziggeo from 'react-native-ziggeo-library';

export default class ZiggeoPlayer extends Component {

  componentDidMount() {
    Ziggeo.setAppToken('applicationToken');
    Ziggeo.play('tokenFromVideoData');
  }

  render() {
    return (
      <View />
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
  },
});

... notes: Video is playing on the player : )

3akat commented 6 years ago

Hi @dancomanlive, We've updated the README with links to the demo project with usage sample.