videojs-panorama icon indicating copy to clipboard operation
videojs-panorama copied to clipboard

How can i play link vimeo or link have redirect CDN

Open dinhtienvu opened this issue 7 years ago • 4 comments

I have link: https://player.vimeo.com/external/245175297.sd.mp4?s=6ee935ec4a992f00e9124234d0219fed676fcf7b&profile_id=164 This link have CDN redirect for fast videolink.

But when i play on iOS, only have audio not movie? (if not panorama video can play normal) Android, PC, Mac all good, only iPhone stuck :(

Demo link: https://codepen.io/vulieumang/pen/KyYwEo

How can play on iOS normaly?

Thank you

dinhtienvu avatar Dec 05 '17 10:12 dinhtienvu

ios Cross domain! you need use iframe element

qiyq avatar Dec 11 '17 07:12 qiyq

I know this issue is pretty old but we had the same issue recently and we managed to work around it with reverse proxies and a bit of URL rewriting.

First step: Replace the player URL with something like that /external/245175297.sd.mp4?s=6ee935ec4a992f00e9124234d0219fed676fcf7b&profile_id=164

Second step: Configure your web server. Here are our Apache and Nginx configuration files in case someone need those.

Apache

<VirtualHost *:80>
    SSLProxyEngine On
    SSLProxyCheckPeerCN on
    SSLProxyCheckPeerExpire on

    RequestHeader set X-Forwarded-Proto https
    AllowEncodedSlashes NoDecode #Mandatory as Akamai use those in their URLs

    ProxyPass /external/ https://player.vimeo.com/external/
    ProxyPassReverse /external/ https://player.vimeo.com/external/

    ProxyPass /akamaized/ https://gcs-vimeo.akamaized.net/ nocanon #Note the nocanon mandatory to avoid URL encoding
    ProxyPassReverse /akamaized/ https://gcs-vimeo.akamaized.net/
</VirtualHost>

Nginx

server {
        listen       80;
        server_name  localhost ;

        location /external {
          proxy_pass      https://player.vimeo.com/external;
          proxy_redirect  https://gcs-vimeo.akamaized.net/ /akamaized/;
        }

        #See https://stackoverflow.com/questions/28684300/nginx-pass-proxy-subdirectory-without-url-decoding/37584637#37584637
        location /akamaized/ {
          rewrite ^ $request_uri;
          rewrite ^/akamaized/(.*) $1 break;
          return 400; #if the second rewrite won't match
          proxy_pass http://127.0.0.1:82/$uri;
        }
}

server {
      listen 82;
      location / {
          proxy_pass https://gcs-vimeo.akamaized.net;
        }
}

Hope this will save some time to someone ;)

nicolasabric avatar Mar 29 '18 13:03 nicolasabric

@nicolasabric Great idea and clear code. But my server work as proxy, I will pay more money for banwitdh?

vulieumang avatar Mar 29 '18 18:03 vulieumang

@vulieumang yes you will. Just out of curiosity I had a look at how Vimeo handle this use case. Turns out they don't :/ They just invite you to download their app, where obviously they can do what they want.

nicolasabric avatar Apr 01 '18 11:04 nicolasabric