ruby on rails - Cannot play MP4 video on LAN in iOS through asset pipeline, but can from WAN -
i'm trying embed <video>
on site , show in dialog box. thought there javascript problem, narrowed down fact ios mobile safari on iphone not play mp4 file local network, direct link. link looks http://localhost:3000/assets/introduction-0cf920e06b4224f8f83f59d02f878b7d5733b09590a14147d1580cbfb5081f18.mp4
except changed localhost
ip of desktop server. load black screen same color first frame of video 2 dashes in middle.
if load hotlink of mp4 staging, plays fine. plays fine in chrome on desktop.
i tried play in ipad ios 9.3.5 , failed play, did display whole play button, did nothing.
if copy video /public
folder, play on ios safari. seems fail when goes through asset pipeline, in development (same file in staging).
how play mp4 video on iphone safari in development environment?
i funneled iphone through fiddler4 proxy , reloaded page. made 2 consecutive requests:
get /assets/introduction-0cf920e06b4224f8f83f59d02f878b7d5733b09590a14147d1580cbfb5081f18.mp4 http/1.1 host: 10.0.0.14:3000 upgrade-insecure-requests: 1 connection: keep-alive accept-encoding: gzip, deflate accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-language: en-us connection: keep-alive user-agent: mozilla/5.0 (iphone; cpu iphone os 10_3_3 mac os x) applewebkit/603.3.8 (khtml, gecko) version/10.0 mobile/14g60 safari/602.1 http/1.1 200 ok content-type: video/mp4 cache-control: public, max-age=31536000 etag: "0cf920e06b4224f8f83f59d02f878b7d5733b09590a14147d1580cbfb5081f18" x-request-id: b97a488d-7141-434f-813d-af4848162a70 x-runtime: 0.058637 content-length: 27555596
and
get /assets/introduction-0cf920e06b4224f8f83f59d02f878b7d5733b09590a14147d1580cbfb5081f18.mp4 http/1.1 host: 10.0.0.14:3000 range: bytes=0-1 x-playback-session-id: a0c3c96e-6f17-47b1-a509-521b3a61d481 accept-encoding: identity accept: */* accept-language: en-us connection: keep-alive connection: keep-alive user-agent: mozilla/5.0 (iphone; cpu iphone os 10_3_3 mac os x) applewebkit/603.3.8 (khtml, gecko) version/10.0 mobile/14g60 safari/602.1 http/1.1 200 ok content-type: video/mp4 cache-control: public, max-age=31536000 etag: "0cf920e06b4224f8f83f59d02f878b7d5733b09590a14147d1580cbfb5081f18" x-request-id: 273865e7-b389-4473-b565-75b2d7ac6559 x-runtime: 0.038530 content-length: 27555596
ios 10.3.3, iphone 5, windows 8.1, rails 5
i experiencing issue. after tests, realized happening in production - led me answer:
tl;dr - don't use asset pipeline serving video, , if possible, put outside of rails server environment entirely.
Comments
Post a Comment