2022年11月5日 星期六

Google DriveToWeb jpg file blocked by CORS policy

Demo link

https://aframe-gallery.glitch.me/

Description information

https://aframe.io/docs/1.3.0/guides/building-a-360-image-gallery.html

1. Copy example into drivetoweb @ Google

2. Replace https://cdn.aframe.io/360-image-gallery-boilerplate/img/city.jpg by local jpg file

3. CORS error

Access to fetch at 'https://drive.google.com/uc?id=1axbPxNB1yL-tdZbKyt__jbjrFYSphzRm' (redirected from 'https://uezbafchzoobug0w05g98q.on.drv.tw/www.092012a.io/GT1.jpg') from origin 'https://uezbafchzoobug0w05g98q.on.drv.tw' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

4. Reduce the size of jpg file (from 4M to 122K).

5. OK



2022年10月25日 星期二

esp32-cam vehicle

 Ref: https://randomnerdtutorials.com/esp32-cam-car-robot-web-server/

1. ASUS X450J @ Windows 10 x64

2. esp32-cam vehicle from

https://shopee.tw/可手機操控及影像顯示的四輪自走車套件 已裝程式及提供原始碼-全套件含ESP32CAM開發板及電池與電機小車4輪底盤-i.4491023.9451496001

3. Download arduino ide

4. Upload Code to ESP32-CAM AI-Thinker (Arduino IDE)

https://randomnerdtutorials.com/program-upload-code-esp32-cam/

5. After uploading, open the Serial Monitor to get its IP address.

6. 移除GPIO0 接地線

7. Reset 

8. 電腦(手機)瀏覽器 http://192.168.1.131 (Serial monitor 回傳ip)






2022年8月17日 星期三

embeded vlc streaming play

 Ref-https://www.cnblogs.com/cplemom/p/13956092.html

WPF app + embedded vlc players

1. new wpf project   framework 4.7.2

2. add nuget package

Install-Package Vlc.DotNet.Wpf -Version 3.1.0

Vlc.DotNet.Core

Vlc.DotNet.Core.Interops

Vlc.DotNet.Wpf

3. xmal file ; add xmlns 

 xmlns:v="clr-namespace:Vlc.DotNet.Wpf;assembly=Vlc.DotNet.Wpf"

4. xaml file add 2 VlcControl

<Grid x:Name="g1" >

        <Grid>

            <v:VlcControl Name="vlcControl1" Margin="427,0,0,0"/>

        </Grid>

        <Grid>

            <v:VlcControl Name="vlcControl2" Margin="0,0,413,0"/>

        </Grid>

    </Grid>

5. xaml.cs file x64 vlcplay 

InitializeComponent();

string VLCPath = @"C:\Program Files\VideoLAN\VLC";

vlcControl1.SourceProvider.CreatePlayer(new System.IO.DirectoryInfo(VLCPath));

string url = @"https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/360/Big_Buck_Bunny_360_10s_30MB.mp4";

if (!string.IsNullOrWhiteSpace(url))

{

      vlcControl1.SourceProvider.MediaPlayer.Play(new Uri(url));

}

vlcControl2.SourceProvider.CreatePlayer(new System.IO.DirectoryInfo(VLCPath));

string url2 = @"rtmp://192.168.1.102/stream/passingcode";

            if (!string.IsNullOrWhiteSpace(url2))

            {

                vlcControl2.SourceProvider.MediaPlayer.Play(new Uri(url2));

            }

5. Select x64 mode 

6. excute rtmp://192.168.1.102/stream/passingcode

7. run

8.Result :