shahen94 / react-native-video-processing

Native Video editing/trimming/compressing :movie_camera: library for React-Native
https://shahen94.github.io/react-native-video-processing/
MIT License
1.25k stars 326 forks source link

Not working in ios latest react native version swift 3 errors #256

Open sidpauhal opened 4 years ago

sidpauhal commented 4 years ago

Library is not working in fresh installed react native version Not even able to run project with react-native run-ios cmd

package.json file

"dependencies": {
    "@react-native-firebase/app": "^6.0.1",
    "@react-native-firebase/ml-vision": "^6.0.1",
    "react": "16.9.0",
    "react-native": "0.61.2",
    "react-native-image-picker": "^1.1.0",
    "react-native-video-processing": "^1.20.0"
  }

below is the errors looks like related to swift 3 Can you update the lib so it can be compatible with latest swift 4 or 5

/Users/siddharth/WhatsIn/node_modules/react-native-video-processing/ios/RNVideoProcessing/RNVideoTrimmer/AVUtilities.swift:22:59: error: 'AVMediaTypeVideo' has been renamed to 'AVMediaType.video'
    guard let videoTrack = original.tracks(withMediaType: AVMediaTypeVideo).last else {
                                                          ^~~~~~~~~~~~~~~~
                                                          AVMediaType.video
AVFoundation.AVMediaTypeVideo:3:12: note: 'AVMediaTypeVideo' was obsoleted in Swift 3
public let AVMediaTypeVideo: AVMediaType
           ^
/Users/siddharth/WhatsIn/node_modules/react-native-video-processing/ios/RNVideoProcessing/RNVideoTrimmer/AVUtilities.swift:44:66: error: 'AVFileTypeQuickTimeMovie' has been renamed to 'AVFileType.mov'
      writer = try AVAssetWriter(outputURL: outputURL, fileType: AVFileTypeQuickTimeMovie)
                                                                 ^~~~~~~~~~~~~~~~~~~~~~~~
                                                                 AVFileType.mov
AVFoundation.AVFileTypeQuickTimeMovie:3:12: note: 'AVFileTypeQuickTimeMovie' was obsoleted in Swift 3
public let AVFileTypeQuickTimeMovie: AVFileType
           ^
/Users/siddharth/WhatsIn/node_modules/react-native-video-processing/ios/RNVideoProcessing/RNVideoTrimmer/AVUtilities.swift:57:53: error: 'AVMediaTypeVideo' has been renamed to 'AVMediaType.video'
    let writerInput = AVAssetWriterInput(mediaType: AVMediaTypeVideo, outputSettings: writerOutputSettings)
                                                    ^~~~~~~~~~~~~~~~
                                                    AVMediaType.video
AVFoundation.AVMediaTypeVideo:3:12: note: 'AVMediaTypeVideo' was obsoleted in Swift 3
public let AVMediaTypeVideo: AVMediaType
           ^

** BUILD FAILED **

The following build commands failed:
    CompileSwift normal x86_64 /Users/siddharth/WhatsIn/node_modules/react-native-video-processing/ios/RNVideoProcessing/RNVideoProcessingManager.swift
    CompileSwift normal x86_64 /Users/siddharth/WhatsIn/node_modules/react-native-video-processing/ios/RNVideoProcessing/RNVideoPlayer.swift
    CompileSwift normal x86_64 /Users/siddharth/WhatsIn/node_modules/react-native-video-processing/ios/RNVideoProcessing/RNTrimmerView/RNTrimmerView.swift
    CompileSwift normal x86_64 /Users/siddharth/WhatsIn/node_modules/react-native-video-processing/ios/RNVideoProcessing/RNTrimmerView/RNTrimmerViewManager.swift
    CompileSwift normal x86_64 /Users/siddharth/WhatsIn/node_modules/react-native-video-processing/ios/RNVideoProcessing/RNVideoTrimmer/RNVideoTrimmer.swift
    CompileSwift normal x86_64 /Users/siddharth/WhatsIn/node_modules/react-native-video-processing/ios/RNVideoProcessing/RNVideoTrimmer/AVUtilities.swift
    CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
forkeer commented 4 years ago

@sidpauhal any solution for fix this problem ?

sidpauhal commented 4 years ago

@shahen94 hi can you recommend any solution?

edferreira commented 4 years ago

@sidpauhal Have you tried with the master version? Add this to your package.json

"react-native-video-processing": "git+https://git@github.com/shahen94/react-native-video-processing.git"

sidpauhal commented 4 years ago

@edferreira yes I have tried it is not working

simenJohnsen commented 4 years ago

I fixed this issue by changing the function to the newest function name in my swift version by pressing the fix button in XCode :)

enigmablue commented 4 years ago

Can we have this fixed in lib please? its breaking on the latest RN

lucastonon commented 4 years ago

I am using 59.9 and If I set Swift version 4, 4.2 or 5 I get thousands of Swift errors.

Is this package without maintenance?

shahen94 commented 4 years ago

@lucastonon This package is under maintenance by the community. So everyone is free to fork & update & open PR to merge