0

Flash Professional CC を使用して iPad 用に構築している小さなアプリで .mp4 ファイルを表示する必要があります。最良の方法は StageWebView のようですが、これを機能させることはできません。トリックを実行するはずのコードをいくつか見つけましたが、エラーが発生し続けます: 1180: 未定義の可能性のあるメソッド ファイルへの呼び出し。

誰でもこれについて助けてもらえますか?

var webView = new StageWebView();
webView.stage = this.stage;
webView.viewPort = new Rectangle( 0, 0, stage.stageWidth, stage.stageHeight);
var path:String = new File(new File("app:/path/file.html").nativePath).url;
webView.loadURL("app:/path/file.html");
4

1 に答える 1

0

iOS の stagewebview を使用して .mp4 ビデオを再生できます。以下の手順に従って作品を入手してください。

    var webView = new StageWebView();
    webView.stage = this.stage;
    webView.viewPort = new Rectangle( 0, 0, stage.stageWidth,   stage.stageHeight);
    var videoFile : File = new File( File.applicationStorageDirectory.resolvePath( "/enter/the/file/path/here" ).nativePath ); //Make sure your .mp4 is located in local store.

    if( videoFile.exists ) //To check file is exist or not
        webView.loadURL( videoFile.url ); //Here given .mp4 file will play using ios native player
  • ファイルがアプリのローカル ストアにある場合、
    例: [app_name]/Local Store/video.mp4

    var videoFile : File = new File( File.applicationStorageDirectory.resolvePath( video.mp4 ).nativePath;
    var path : String = ( videoFile.exists ) ? videoFile.url : "";
    

ノート:

Application Directory = File.applicationDirectory.resolvePath("file/path/application/directory");
Documents Directory = File.documentsDirectory.resolvePath("file/path/in/documents");
User Directory = File.userDirectory.resolvePath("path/from/user/");
于 2015-10-13T13:28:16.023 に答える