Блог очередного разработчика

Sanasol

Mobile Chrome http streaming(m3u8) doesnt work

Wrong X-TARGETDURATION in m3u8 playlist causes error on Andorid Chrome.
Error not visible in console or everywhere else, so its really hard to detect.
Chrome Desktop ignore this error for some reason, but mobile sensitive to it.

I have wrongly thought that it should be full video duration.

Solution is: X-TARGETDURATION should contain duration of longest video fragment.

Here is an example of a Media Playlist:

#EXTM3U
#EXT-X-TARGETDURATION:10

#EXTINF:9.009,
http://media.example.com/first.ts
#EXTINF:9.009,
http://media.example.com/second.ts
#EXTINF:3.003,
http://media.example.com/third.ts

The first line is the format identifier tag #EXTM3U. The line
containing #EXT-X-TARGETDURATION says that all Media Segments will be
10 seconds long or less. Then three Media Segments are declared.
The first and second are 9.009 seconds long; the third is 3.003
seconds.

Specs

Debian Jessie bitcoind BerkeleyDB

Installing dependencies like here build unix

BerkeleyDB is required for the wallet.

Debian repository doesn’t contains libdb4.8. So need to get sources and compile it manually.

Get db4.8 source, compile and install:

Tell your system where to find db4.8

Then move to bitcoin sources folder and compile it:

Sources:
https://github.com/bitcoin/bitcoin/issues/3686#issuecomment-35211263
https://github.com/bitcoin/bitcoin/issues/3686#issuecomment-35236768

MySQL utf8 Incorrect string value

How to fix “Incorrect string value” errors?
Mysql support only 3 bytes in «basic» utf8.
So in case of use some new characters like emoji it gives Incorrect string value error.

To fix this error you need change encoding utf8 to utf8bm4.

CloudFlare отдача и кеширование видео

CloudFlare Caching
CloudFlare Caching

Стриминг видео с сервера очень сильно кушает канал. Поэтому появляется мысль кешировать видео через CloudFlare.
При этом надо сохранить возможность перемотки и разбить файлы на небольшие куски, чтобы CF ничего не заподозрил, а так же не попасть под лимит который не кешируется.
Будем использовать Uppod плеер.

1. Разбить видео
2. Создать страницу сайта

UP 19.07 Трафик продолжает снижаться

(далее…)

Ubuntu Gnome huge CPU usage of gnome-keyring-daemon when starting Google Chrome

gnome keyring cpu
gnome keyring cpu

I have a lot saved passwords in Google Chrome about 2000.
So when I try to sync it on any linux distr. I got high cpu usage from keyring daemon.

To prevent it we need disable password encryption ;(
1. Open Terminal
2.

or

3. Find these lines at end of file

4. Replace with

5. Save it.
6. Kill all keyring processes.
7. Restart Chrome, wait password sync.
8. Profit!

Laravel 5.2 + JWT + Dingo API + PHPUnit

The token could not be parsed from the request
The token could not be parsed from the request

The token could not be parsed from the request

For some magic reasons(simulating requests) phpunit can’t pass tests with JWT token header or GET param token=?.

Solution is just add few lines to middleware or anywhere else like this.

Got it work with this code in my middleware:

Result middleware for api auth

Result :)
Result 🙂