【问题标题】:How to display StageWebView page in .ipa app from Flash Professional如何在 Flash Professional 的 .ipa 应用程序中显示 StageWebView 页面
【发布时间】:2015-05-19 08:18:10
【问题描述】:

我需要在使用 Flash Professional CC 为 iPad 构建的小应用程序中显示 .mp4 文件。最好的方法看起来是 StageWebView,但我无法让它工作。我找到了一些应该可以解决问题的代码,但我不断收到错误消息:1180:调用可能未定义的方法 File。

谁能帮我解决这个问题?

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");

【问题讨论】:

    标签: flash stagewebview


    【解决方案1】:

    您可以在 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/");
    

    【讨论】:

      猜你喜欢
      • 2017-03-30
      • 1970-01-01
      • 2015-06-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-08
      相关资源
      最近更新 更多