Ziggeo / ReactNativeSDK

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

How to get the uploaded video url? #85

Closed bobananto24 closed 2 years ago

bobananto24 commented 3 years ago

while trying to play the uploaded video from ios the video is not playing. so I have decided to use third party video player. But I am struggling to get the video url. Your suggestions will be more helpful

Bane-D commented 3 years ago

Hi Boban, if there is something causing the videos to not be playable through our player there is a great chance the same will not allow you to play it from another player.

There are several settings (in dashboard) that could cause this, as well as your setup, so might be best to first try and see what you are using.

Would you mind sharing the part of the code that is used for playing back the video so that we can check it out? Also if you can let us know what happens when you try to play the uploaded video.

bobananto24 commented 2 years ago

@Bane-D in fact, I couldn't even record the video on iPhone. Till now I have been working in an ios simulator where we cannot record video, so I have tried

import Ziggeo from "react-native-ziggeo-library";
Ziggeo.play("2a2f56f8a0abba209ac9c29bcb3de3aa");

then the video is kind of playing in the background (ie, I could hear the audio but there were no visual changes) then later when I tried with a real iPhone to record a video, the recorder open for a fraction of a second and closes suddenly

async function record(saveId) {
    var appToken = ZIGGEO_APP_TOKEN;
    Ziggeo.setAppToken(appToken);
    Ziggeo.setMaxRecordingDuration(20);
    Ziggeo.setCameraSwitchEnabled(true);
    Ziggeo.setCoverSelectorEnabled(true);
    Ziggeo.setCamera(Ziggeo.FRONT_CAMERA);
    const recorderEmitter = Ziggeo.recorderEmitter();
    const subscription = recorderEmitter.addListener(
      "UploadProgress",
      (progress) =>
        console.log(
          progress.fileName +
            " uploaded " +
            progress.bytesSent +
            " from " +
            progress.totalBytes +
            " total bytes"
        )
    );
    try {
      var token = await Ziggeo.record();
      console.log("Token:" + token);
      if (token) {
        ziggeoSave(token, saveId);
      }
    } catch (e) {
      alert(e);
    }
  } 

this is the code I am using for recording

  1. NOTE: Everything is working perfectly fine in android
  2. another NOTE : pod 'iOS-Client-SDK', :git => 'https://github.com/Ziggeo/iOS-Client-SDK.git', :commit => '295f90fc8777ebe63135359e20fa144409d02e54' this is the ios client sdk i am using where i couldn't build the app with the latest one i got this solution from #75 A solution for this issue will be mre helpful, thanks
katolykdev commented 2 years ago

Hi, @bobananto24

  1. You have to install latest install react-native-ziggeo-library. "react-native-ziggeo-library": "^1.6.1",

  2. Ziggeo.play(VIDEO_TOKEN); was deprecated. Please use Ziggeo.playVideo(VIDEO_TOKEN);

  3. Ziggeo.record(); was deprecated. Please use Ziggeo.startCameraRecorder();

bobananto24 commented 2 years ago

thanks @katolykdev but Ziggeo.playVideo(VIDEO_TOKEN) is not working in "ANDROID" (but working in ios simulator) the error is : TypeError: ZiggeoPlayer.playVideo is not a function

3akat commented 2 years ago

Ziggeo.playVideo(VIDEO_TOKEN) is not working in "ANDROID" (but working in ios simulator) the error is : TypeError: ZiggeoPlayer.playVideo is not a function

fixed in 1.6.3