将来的なMoodleバージョンアップ時にカスタマイズが困難になるかと思いますので、Moodleのプログラムを修正するのではなく、以下のようなPHPファイルを使ってアクセス元を切り分けられてはいかがでしょうか。
<?php
if (!isset($_GET['file'])) {
$file = null;
} else {
$file = $_GET['file'];
}
$ip = $_SERVER['REMOTE_ADDR'];
$url = "https://freegeoip.app/json/" . $ip;
$json = file_get_contents($url);
$data = json_decode($json, TRUE);
if ($data['country_code'] == 'CN') {
echo "<iframe src='https://your_filerepo.com/cn/' . $file></iframe>";
} else {
echo "<iframe src='https://your_filerepo.com/' . $file></iframe>";
}
例えば上のPHPファイル名が「movie_files.php」の場合、以下の例のようなURLで動画ファイル (test.m3u8) を指定できます。
例)
https://your_moodle.com/movie_files.php&file=test.m3u8
参考資料:
[How to Display Unique Content Based on Geolocation - Advice Interactive]
https://www.adviceinteractivegroup.com/blog/how-to-display-unique-content-based-on-geolocation/