2017-01-24 8 views
3

私はソーシャルサイトでビデオを共有するためにソーシャルシェアリングプラグインを使用しようとしています。これまでのところは何か私が達成している、私は成功し、次のコード使用してビデオをキャプチャしている - 私が正常にキャプチャしたビデオファイルのURLを見つけることができますIonic Cordovaはソーシャルサイトでビデオを共有できません

var options = { 
       limit: 1, 
       duration: 15 
      }; 

$cordovaCapture.captureVideo(options).then(function (videoData) { 
       $scope.videoUrl = videoData[0].fullPath; 
      }, function (err) { 
       // An error occurred. Show a message to the user 
       //alert("video error : "+err); 
      }); 

を残念ながら私は、ソーシャルメディアサイトにそれらを共有することはできません。私は、次の方法の両方を試してみました -

$cordovaSocialSharing 
.share(message, subject, file, link) 

$cordovaSocialSharing 
.shareViaTwitter(message, image, link) 

今私の質問は -

  1. このアプローチを使用してビデオを共有する方法はありますか?
  2. もしそうでない場合は、可能な方法があれば教えてください。

N.B. :私はすでにGoogleに多くの関心を寄せている。

ありがとうございます。

私の問題が悪いfilePathに渡すたので、私は以下のような解決策を見つけた
+0

に私のビデオファイルをコピーし、あなたがどんな解決策を見つけました? – settaratici

+0

まだありませんが、このトピックに関するいくつかの情報が見つかりました。現在、それに取り組んでいません。しかし、うまくいけば、私はすぐにこの本物に戻るだろう。私の所見をここに掲載することも考えています。尋ねていただきありがとうございます。 問題についての指導はありますか? –

答えて

0

import {CaptureError, MediaFile, MediaCapture, CaptureImageOptions, Transfer} from "ionic-native";` 

declare let cordova: any; 

private static options = { 
    message: '', // not supported on some apps (Facebook, Instagram) 
    subject: '', // for email 
    files: [''], // an array of filenames either locally or remotely 
    url: '' 
    }; 

videoOptions: CaptureImageOptions = {limit: 1}; 
videoData: any; 

captureVideo() { 
    MediaCapture.captureVideo(this.videoOptions) 
     .then(
     (data: MediaFile[]) => { 
      this.videoData = data[0]; 
      const fileTransfer = new Transfer(); 
      fileTransfer.download(this.videoData.fullPath, cordova.file.applicationStorageDirectory + 'fileDir/filename.mp4').then((entry) => { 

      this.options.message = " Your message"; 
      this.options.subject = "Your Subject"; 
      this.options.files = [entry.toURL()]; 
      this.options.url = "https://www.google.com.tr/"; 

      SocialSharing.shareWithOptions(this.options); 

      }, (error) => { 
      }); 
     }, 
     (err: CaptureError) => { 
     } 
    ); 
    } 

あなたは上記を参照したように、私はちょうどapplicationStorageDirectory

+0

あなたの答えをありがとう。私はそれを試み、あなたに知らせるでしょう。 :) –

関連する問題