0

我想在我们的 alfresco 系统上使用嵌入式 windows 媒体播放器来显示 .mkv 等。我已经在 alfresco 上定义了 windows 媒体播放器,但它无法解析与 Internet Explorer 不同的视频 url。我默认使用来自 web-preview.js 的 url,它也为其他玩家提供 url。当我尝试使用共享按钮然后查看按钮时,我可以在每个浏览器上观看视频。

所以,我放弃了尝试从 web-preview.js 调整 url。我只想快速分享视频详细信息页面的源网址。

可能吗?这是我的超级课。默认情况下从未更改:

 getContentUrl: function WP_getContentUrl(download)
  {
     var proxy = window.location.protocol + "//" + window.location.host + Alfresco.constants.URL_CONTEXT + "proxy/" + this.options.proxy + "/",
        nodeRefAsLink = this.options.nodeRef.replace(":/", ""),
        noCache = "noCache=" + new Date().getTime();
     download = download ? "a=true" : "a=false";
     return proxy + this.options.api + "/node/" + nodeRefAsLink + "/content/" + encodeURIComponent(this.options.name) + "?c=force&" + noCache + "&" + download
  },

  getContentUrl: function WP_getContentUrl(download)
  {
     var proxy = window.location.protocol + "//" + window.location.host + Alfresco.constants.URL_CONTEXT + "proxy/" + this.options.proxy + "/",
        nodeRefAsLink = this.options.nodeRef.replace(":/", ""),
        noCache = "noCache=" + new Date().getTime();
     download = download ? "a=true" : "a=false";
     return proxy + this.options.api + "/node/" + nodeRefAsLink + "/content/" + encodeURIComponent(this.options.name) + "?c=force&" + noCache + "&" + download
  },


  getThumbnailUrl: function WP_getThumbnailUrl(thumbnail, fileSuffix)
  {
     var proxy = window.location.protocol + "//" + window.location.host + Alfresco.constants.URL_CONTEXT + "proxy/" + this.options.proxy + "/",
        nodeRefAsLink = this.options.nodeRef.replace(":/", ""),
        noCache = "noCache=" + new Date().getTime(),
        force = "c=force";

     // Check to see if last modification data is available for the thumbnail...
     for (var i = 0; i < this.options.thumbnailModification.length; i++)
     {
        if (this.options.thumbnailModification[i].indexOf(thumbnail) != -1)
        {
           noCache = "lastModified=" + encodeURIComponent(this.options.thumbnailModification[i]) + "&" + noCache;
           break;
        }
     }
     return proxy + this.options.api + "/node/" + nodeRefAsLink + "/content/thumbnails/" + thumbnail + (fileSuffix ? "/suffix" + fileSuffix : "") + "?" + force + "&" + noCache
  }      

这就是我的代码的显示方法,它不适用于 firefox、chrome、opera 等:

display: function Video_display()
   {
       var src = this.attributes.src ? this.wp.getThumbnailUrl(this.attributes.src) : this.wp.getContentUrl();

        var height=240;   
        var width=320;    
        var player = '<object ';
        player += 'height="' + height.toString() + '" ';
        player += 'width="' + width.toString() + '" ';

        if (navigator.userAgent.indexOf("MSIE") < 0) {
            // Chrome, Firefox, Opera, Safari
            player += 'type="application/x-ms-wmp" ';
            player += 'data="' + src + '" >';
        }
        else {
            // Internet Explorer
            player += 'classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6" >';
            player += '<param name="url" value="' + src + '" />';
        }

        player += '<param name="autoStart" value="false" />';
        player += '<param name="playCount" value="1" />';
        player += '</object>';

        return player;
   }
4

0 回答 0