# getSnapshot Player API function returns blank (webp/png) or black(jpeg)

**URL:** https://community.bitmovin.com/t/getsnapshot-player-api-function-returns-blank-webp-png-or-black-jpeg/1712
**Category:** Support
**Tags:** html5-player, bitmovin-player, bitmovin
**Created:** [February 16, 2023, 9:05am UTC](https://community.bitmovin.com/t/getsnapshot-player-api-function-returns-blank-webp-png-or-black-jpeg/1712 "2023-02-16T09:05:55Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![f.stivicic](https://avatars.discourse-cdn.com/v4/letter/f/ee7513/32.png) [@f.stivicic](https://community.bitmovin.com/u/f.stivicic)
#### Post date: [February 16, 2023, 9:05am UTC](https://community.bitmovin.com/t/getsnapshot-player-api-function-returns-blank-webp-png-or-black-jpeg/1712/1 "2023-02-16T09:05:55Z")

</div>

Manage to get the snapshot with these settings on Safari:

> [@Players getSnapshot - Safari problem](https://community.bitmovin.com/t/players-getsnapshot-safari-problem/1467):
>
> Hi, I am using player [getSnapshot](https://bitmovin-a.akamaihd.net/bitmovin-player/stable/7/docs/interfaces/playerapi.playerapi-1.html#getsnapshot)() function. I get an undefined return value only in Safari. Chrome and Firefox are working fine.

Now the returned base64 images are black (jpeg) or blank (set to webp, got png).

API works fine on other browsers.

Safari 16.2 on Mac mini M1 2020, MacOS 12.6.2 - NOT WORKING  
Safari 16.1 on MacBook Air 2019, MacOS 13 - WORKING

Tried to set directly base64 to the lower-canvas element, tried to set the video element in the same canvas with drawImage, and set background-image CSS prop until realized that getSnapshot is not returning a valid snapshots in above mentioned case.

---

<div class="post-metadata">

### Author: ![daniel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.bitmovin.com/daniel/32/121_2.png) [@daniel](https://community.bitmovin.com/u/daniel)
#### Post date: [February 21, 2023, 8:52am UTC](https://community.bitmovin.com/t/getsnapshot-player-api-function-returns-blank-webp-png-or-black-jpeg/1712/2 "2023-02-21T08:52:39Z")

</div>

Hi,

As you already know from the thread you linked, browsers can prevent access to the video frames (e.g. in the default setup of Safari, we’re getting `The operation is insecure` reject message from the browser).

I can’t really reproduce the problem with the black or blank image though (using Safari 16.3 on macOS 13.2). Could you please let me know if you see this problem also on [Bitmovin Player Demo](https://demo.bitmovin.com/public/community-samples/1712.html)? Thanks!

Regarding you comment

> set to webp, got png

The player depends on browser support. While Safari [supports WebP images](https://caniuse.com/webp) in general, it doesn’t [support WebP in Canvas-related methods](https://caniuse.com/mdn-api_htmlcanvaselement_todataurl_type_parameter_webp) (which are used to create the snapshot).

---

<div class="post-metadata">

### Author: ![f.stivicic](https://avatars.discourse-cdn.com/v4/letter/f/ee7513/32.png) [@f.stivicic](https://community.bitmovin.com/u/f.stivicic)
#### Post date: [February 21, 2023, 10:12am UTC](https://community.bitmovin.com/t/getsnapshot-player-api-function-returns-blank-webp-png-or-black-jpeg/1712/3 "2023-02-21T10:12:04Z")

</div>

Hi Daniel,  
Thank you for your response. This is the result with your sample.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/bitmovin/original/1X/c2f4ed4c0768dde3d89787fa5ce3bf6f79509218.jpeg)

---

<div class="post-metadata">

### Author: ![f.stivicic](https://avatars.discourse-cdn.com/v4/letter/f/ee7513/32.png) [@f.stivicic](https://community.bitmovin.com/u/f.stivicic)
#### Post date: [February 21, 2023, 10:20am UTC](https://community.bitmovin.com/t/getsnapshot-player-api-function-returns-blank-webp-png-or-black-jpeg/1712/4 "2023-02-21T10:20:19Z")

</div>

Another setup:

 ![image (7)](https://us1.discourse-cdn.com/flex015/uploads/bitmovin/original/1X/cdac385c48179bab21d8d638b6eed6ab20bb8201.jpeg)

---

<div class="post-metadata">

### Author: ![daniel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.bitmovin.com/daniel/32/121_2.png) [@daniel](https://community.bitmovin.com/u/daniel)
#### Post date: [February 21, 2023, 10:40am UTC](https://community.bitmovin.com/t/getsnapshot-player-api-function-returns-blank-webp-png-or-black-jpeg/1712/5 "2023-02-21T10:40:13Z")

</div>

Sorry, I ended up uploading the wrong version of that page 🤦‍♂️ sorry for the confusion. Can you please try again (same link)?

---

<div class="post-metadata">

### Author: ![daniel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.bitmovin.com/daniel/32/121_2.png) [@daniel](https://community.bitmovin.com/u/daniel)
#### Post date: [February 21, 2023, 10:45am UTC](https://community.bitmovin.com/t/getsnapshot-player-api-function-returns-blank-webp-png-or-black-jpeg/1712/6 "2023-02-21T10:45:17Z")

</div>

By the way, this isn’t a very widely used feature (for example, because it doesn’t work with DRM protected content) so I’m really curious to learn more about your use case for this!

---

<div class="post-metadata">

### Author: ![f.stivicic](https://avatars.discourse-cdn.com/v4/letter/f/ee7513/32.png) [@f.stivicic](https://community.bitmovin.com/u/f.stivicic)
#### Post date: [February 27, 2023, 4:03pm UTC](https://community.bitmovin.com/t/getsnapshot-player-api-function-returns-blank-webp-png-or-black-jpeg/1712/7 "2023-02-27T16:03:09Z")

</div>

Hi Daniel, thank you for the updates.  
The first configuration with mac mini is not displaying frame. The console outputs the img element and the img element is present in HTML. But the base64 set as the src is **transparent PNG**.

The use case is capturing a frame from video so it can be edited/annotated by a user in a canvas element (drawing arrows, writing text on the image, etc…)

---

<div class="post-metadata">

### Author: ![daniel](https://sea1.discourse-cdn.com/flex015/user_avatar/community.bitmovin.com/daniel/32/121_2.png) [@daniel](https://community.bitmovin.com/u/daniel)
#### Post date: [March 3, 2023, 11:57am UTC](https://community.bitmovin.com/t/getsnapshot-player-api-function-returns-blank-webp-png-or-black-jpeg/1712/8 "2023-03-03T11:57:53Z")

</div>

Thanks for sharing this with me.

After further looking into this, I’m afraid there’s not much we can do. It seems that some system/browser configurations don’t allow this use case. I haven’t seen the transparent PNG myself though, in my tests it either works, or the browser throws an error at us.
