# Videotexture can't show the video on ios. but laptop works

**URL:** <https://discourse.threejs.org/t/videotexture-cant-show-the-video-on-ios-but-laptop-works/39758>\
**Category:** Questions\
**Tags:** ios, video-texture\
**Created:** [June 28, 2022, 4:58pm UTC](https://discourse.threejs.org/t/videotexture-cant-show-the-video-on-ios-but-laptop-works/39758 "2022-06-28T16:58:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuansavage](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/yuansavage/32/48244_2.png) [@yuansavage](https://discourse.threejs.org/u/yuansavage)\
**Post date:** [June 28, 2022, 4:58pm UTC](https://discourse.threejs.org/t/videotexture-cant-show-the-video-on-ios-but-laptop-works/39758/1 "2022-06-28T16:58:45Z")

</div>

Hey everyone,

I am trying to embbed the video to the planeGeometry via videoTexture. the original settings like below:

```
 const vid = document.createElement("video");
  vid.src = "data/test.mp4";
  vid.currentTime = 0.1;
  vid.crossOrigin = "Anonymous";
  vid.playsInline = false;
  vid.muted = true; 
  vid.setAttribute("webkit-playsinline", "webkit-playsinline");
  vid.setAttribute("playsinline", "playsinline");

```

And I use react-three-fiber to render

```
<planeGeometry attach="geometry" args={[2, 1, 10]} />
  <meshBasicMaterial
    color="white"
    side={DoubleSide}
    transparent={false}
    opacity={1}
  >
    <videoTexture attach="map" args={[video]} />
</meshBasicMaterial>

```

It works when I open the website on laptop and android phone.  
But the ios CAN’T.

Can anyone can help? thanks !

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [June 28, 2022, 9:20pm UTC](https://discourse.threejs.org/t/videotexture-cant-show-the-video-on-ios-but-laptop-works/39758/2 "2022-06-28T21:20:02Z")

</div>

Can you please verify if the following example runs on your iOS device?

[https://threejs.org/examples/webgl\_video\_panorama\_equirectangular](https://threejs.org/examples/webgl_video_panorama_equirectangular)

---

<div class="post-metadata">

**Author:** ![yuansavage](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/yuansavage/32/48244_2.png) [@yuansavage](https://discourse.threejs.org/u/yuansavage)\
**Post date:** [June 29, 2022, 8:19am UTC](https://discourse.threejs.org/t/videotexture-cant-show-the-video-on-ios-but-laptop-works/39758/3 "2022-06-29T08:19:01Z")

</div>

Thanks for replying. Yes, this example can work on my ios device.

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [June 29, 2022, 10:36am UTC](https://discourse.threejs.org/t/videotexture-cant-show-the-video-on-ios-but-laptop-works/39758/4 "2022-06-29T10:36:55Z")

</div>

Strange. Do you mind sharing your entire code as a live example (codesandbox, fiddle etc.)?

---

<div class="post-metadata">

**Author:** ![koljam](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/koljam/32/48237_2.png) [@koljam](https://discourse.threejs.org/u/koljam)\
**Post date:** [May 30, 2024, 8:44am UTC](https://discourse.threejs.org/t/videotexture-cant-show-the-video-on-ios-but-laptop-works/39758/5 "2024-05-30T08:44:15Z")

</div>

I had a similar issue. For others searching: My video was in the wrong codec for iOS devices. iOS has limited support for H.265/HEVC encoded videos. To ensure compatibility, you should use the H.264 codec.

`ffmpeg -i input_video.mp4 -vcodec libx264 -crf 28 -preset slow -pix_fmt yuv420p output_video.mp4`

Hope this helps someone.
