Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Ptitloup/feature video p2p #925

Draft
wants to merge 73 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
4bdbc70
implement p2p-media-loader : https://github.com/Novage/p2p-media-load…
ptitloup Aug 28, 2023
ce34c8e
add p2p configuration in video script - show p2p stat in video_page_c…
ptitloup Aug 29, 2023
1b15d8f
add minus in stats info
ptitloup Aug 30, 2023
183a1cb
Merge branch 'develop' of https://github.com/EsupPortail/Esup-Pod int…
ptitloup Aug 30, 2023
e781dd7
change npm package to get videojs8 and p2p media loader from peertube…
ptitloup Sep 7, 2023
8c30e02
merge package.json
ptitloup Sep 7, 2023
6d7d0fc
add videojs-hlsjs-plugin.js
ptitloup Sep 7, 2023
74b20c2
workon videojs 8 plugin - ok for logo, quality selector, p2p, remove …
ptitloup Sep 7, 2023
d310993
remove chapter plugin from videojs and use video text track in webvtt…
ptitloup Sep 8, 2023
22f80c8
merge develop - fix conflicts
ptitloup Sep 8, 2023
743e85f
remove chapter from video element and add overview
ptitloup Sep 8, 2023
a4c081e
fix get element by id for playlist
ptitloup Sep 8, 2023
810ab24
remove plugin to show info in modal and use videojs api modal plyaer …
ptitloup Sep 8, 2023
56337bf
add settgins for the p2p function and improve display of p2p stats
ptitloup Sep 8, 2023
319ff1d
add jsdoc and readme - add p2p js only if p2p feature is activated - …
ptitloup Sep 11, 2023
9b23773
Merge branch 'develop' of https://github.com/EsupPortail/Esup-Pod int…
ptitloup Sep 11, 2023
334227f
add video-p2p-stats.js to store all p2p event function - add p2p to l…
ptitloup Sep 11, 2023
ed9a83e
create template to show p2p stats and call it from another template -…
ptitloup Sep 12, 2023
e4dd235
pull develop and remove videojs-info-controlbar.js
ptitloup Sep 12, 2023
5e796af
change firstplay by one play to deal with new videojs8 api - improvin…
ptitloup Sep 12, 2023
c25774d
use default configuration in live script for p2p
ptitloup Sep 13, 2023
c507eb4
replace videojs hlsjs plugin by the original - use the good init func…
ptitloup Sep 18, 2023
31aa5f8
[WIP] Update HLS with hls-plugin (#4)
SebastienCozeDev Oct 12, 2023
d2978ed
Merge develop
SebastienCozeDev Oct 13, 2023
200252c
make lang
SebastienCozeDev Oct 13, 2023
42ad6e3
Fix .mo
SebastienCozeDev Oct 13, 2023
add831d
Add buffer length
SebastienCozeDev Oct 13, 2023
04b935f
Fix conflicts
AymericJak Nov 6, 2023
523e35b
Merge branch 'develop' of https://github.com/EsupPortail/Esup-Pod int…
AymericJak Nov 7, 2023
d2f86ea
Replace deprecated methods & fix viewcounter
AymericJak Nov 7, 2023
4046e4b
Replace deprecated functions & remove redundant import
AymericJak Nov 7, 2023
1e5565b
Improve QoC of event-script.html file
AymericJak Nov 8, 2023
c6b2e57
Add Pod resolutions plugin
AymericJak Nov 8, 2023
add2355
Fix viewcounter import
AymericJak Nov 8, 2023
ab8a71e
Replace deprecated methods & remove imports
AymericJak Nov 9, 2023
a110b0c
Add parameters for video hls js config
AymericJak Nov 9, 2023
945079f
Pull develop
AymericJak Nov 9, 2023
93aff4c
QoC - Part 1
AymericJak Nov 10, 2023
10f50fb
QoC - Part 2 - hls-plugin
AymericJak Nov 10, 2023
ec8d234
QoC - Part 3
AymericJak Nov 10, 2023
4adad31
Fix chapters
AymericJak Nov 10, 2023
f12eaad
Fix conflicts
AymericJak Nov 20, 2023
5c6e4e6
Create the peer to peer application & the USE_PEER_TO_PEER setting
SebastienCozeDev Dec 12, 2023
fdc41ca
Add test
SebastienCozeDev Dec 12, 2023
618881a
Add test
SebastienCozeDev Dec 13, 2023
df56953
Resolve request bug
SebastienCozeDev Dec 14, 2023
82c8b5a
Rename functions
SebastienCozeDev Dec 14, 2023
9152e09
Add getIds function
SebastienCozeDev Dec 14, 2023
917a6fd
Update the getIds() function
SebastienCozeDev Dec 14, 2023
e6299fe
Fix peerID
AymericJak Dec 14, 2023
1189eff
Merge branch 'ptitloup/feature_video_p2p' of https://github.com/ptitl…
AymericJak Dec 14, 2023
4eb2da2
Fix storeUrlsId
AymericJak Dec 14, 2023
46e7d46
Rename videoId
AymericJak Dec 14, 2023
453a8d5
Update p2p-script.js
SebastienCozeDev Dec 14, 2023
61b14b8
Merge branch 'ptitloup/feature_video_p2p' of https://github.com/ptitl…
SebastienCozeDev Dec 14, 2023
cfcf1e3
Linting & doc
AymericJak Dec 14, 2023
2774bfb
Fix conflicts
AymericJak Dec 14, 2023
853b733
Merge branch 'develop' of https://github.com/EsupPortail/Esup-Pod int…
AymericJak Dec 14, 2023
929e018
Add connection to an other peer
SebastienCozeDev Dec 14, 2023
113d0b7
Merge develop
SebastienCozeDev Dec 14, 2023
3ac24e1
Add connectToAnyPeers
SebastienCozeDev Dec 15, 2023
56e73b4
Add clear invalid peer from caches view
AymericJak Dec 15, 2023
04359c1
Merge branch 'ptitloup/feature_video_p2p' of https://github.com/ptitl…
AymericJak Dec 15, 2023
83c5ad0
Update caches
AymericJak Dec 15, 2023
485cc75
Add connectToAnyPeers and connectToNextPeer function (not work)
SebastienCozeDev Dec 15, 2023
91ff5a2
Add beforeRequest redefine
SebastienCozeDev Dec 15, 2023
cb6688b
Add the P2p object
SebastienCozeDev Dec 15, 2023
ebc3520
Increase timeout for caches
AymericJak Dec 15, 2023
ee7944b
Fix conflicts
AymericJak Jan 4, 2024
5b37864
Manage peers in caches
AymericJak Jan 5, 2024
c6d6bf1
- Add & update documentation
SebastienCozeDev Jan 5, 2024
0193cee
Add the numberofConnections var
SebastienCozeDev Jan 16, 2024
7bbea0f
Merge develop
SebastienCozeDev Jan 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 0 additions & 68 deletions pod/live/templates/live/event-iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,80 +140,12 @@ <h2 class="video-title">{{ event.title }}</h2>

{# affichage du bouton d'info sur le player #}
{% if event.is_coming and event.video_on_hold.is_video or event.is_current %}

<script>
{% if event.is_coming and event.video_on_hold.is_video %}
iframeplayer = videojs("podvideoonholdplayer");
{% else %}
iframeplayer = videojs("podvideoplayer");
{% endif %}

iframeplayer.videoJsInfo();

function setOnPlayerPlayPause() {
iframeplayer.on('play', function () {
isPlaying = true;
$('#div-video-wrapper').attr('class', '')
})
iframeplayer.on('pause', function () {
isPlaying = false;
})
}

$('#div-video-wrapper').append('<div id="overlay-footer"></div>')
iframeplayer.ready(function () {
const btinfo = $('.vjs-info-button:eq(0)')[0]
$(btinfo).clone().appendTo('#overlay-footer')
$('#overlay-footer .vjs-info-button').click(function () {
$(btinfo).click()
})
})
$(document).on('click', '.close', function () {
show_info_video()
});

// Responsive
const hdres = 1920 / 1080;
let isPlaying = false, wasPlaying = false
setOnPlayerPlayPause()

function resizeInfo() {
const ihead = document.querySelector('#info-video-wrapper > .iframe-header')
, ph = iframeplayer.el().offsetHeight
, pb = parseInt(iframeplayer.el().style.top) + ph - 30
, pw = ph * hdres//$('#podvideoplayer .vjs-poster').width()
$('#info-video').css('top', ihead.offsetHeight + 'px')
$('#info-video-wrapper').css({
top: iframeplayer.el().style.top,
height: (ph - 30) + 'px',
left: '50%',
'margin-left': -(pw / 2) + 'px',
width: pw + 'px'
})
$('#overlay-footer').css({'top': pb + 'px'})
}

let show_info_video = function () { // Call by videojs-controllbar
const hasStarted = $(iframeplayer.el()).hasClass('vjs-has-started')
, isOverlayed = $('#div-video-wrapper').hasClass('overlay')
, isInfoOverlayed = isOverlayed && $('#div-video-wrapper').hasClass('info')
, cls = 'overlay info'
if (!isOverlayed) { // No overlay is displayed
wasPlaying = isPlaying;
iframeplayer.pause();
$('#div-video-wrapper').attr('class', cls)
resizeInfo()
} else if (!isInfoOverlayed) { // One overlay is displayed but not Info
$('#div-video-wrapper').attr('class', cls)
resizeInfo()
} else { // Info overlay is displayed => close
$('#div-video-wrapper').attr('class', (hasStarted ? '' : 'vjs-not-started'))
if (wasPlaying) iframeplayer.play();
}
}

$('#video-meta .tab-pane').addClass('show').show();

</script>
{% endif %}

Expand Down
186 changes: 115 additions & 71 deletions pod/main/configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -859,33 +859,33 @@
]
},
"settings": {
"RESTRICT_EDIT_IMPORT_VIDEO_ACCESS_TO_STAFF_ONLY": {
"default_value": true,
"MAX_UPLOAD_SIZE_ON_IMPORT": {
"default_value": 4,
"description": {
"en": [
"Only \"staff\" users will be able to import videos"
"Maximum size in Gb of video files that can be imported into the platform ",
"via the import_video application (0 = no maximum size)."
],
"fr": [
"Seuls les utilisateurs \"staff\" pourront importer des vidéos"
"Taille maximum en Go des fichiers vidéos qui peuvent être importés sur la plateforme ",
"via l'application import_video (0 = pas de taille maximum)."
]
},
"pod_version_end": "",
"pod_version_init": "3.3.0"
"pod_version_init": "3.4.0"
},
"MAX_UPLOAD_SIZE_ON_IMPORT": {
"default_value": 4,
"RESTRICT_EDIT_IMPORT_VIDEO_ACCESS_TO_STAFF_ONLY": {
"default_value": true,
"description": {
"en": [
"Maximum size in Gb of video files that can be imported into the platform ",
"via the import_video application (0 = no maximum size)."
"Only \"staff\" users will be able to import videos"
],
"fr": [
"Taille maximum en Go des fichiers vidéos qui peuvent être importés sur la plateforme ",
"via l'application import_video (0 = pas de taille maximum)."
"Seuls les utilisateurs \"staff\" pourront importer des vidéos"
]
},
"pod_version_end": "",
"pod_version_init": "3.4.0"
"pod_version_init": "3.3.0"
},
"USE_IMPORT_VIDEO": {
"default_value": true,
Expand Down Expand Up @@ -1589,31 +1589,31 @@
]
},
"settings": {
"DEFAULT_PLAYLIST_THUMBNAIL": {
"default_value": "/static/playlist/img/default-playlist.svg",
"COUNTDOWN_PLAYLIST_PLAYER": {
"default_value": 0,
"description": {
"en": [
"Default image displayed as a poster or thumbnail, used to present the playlist.",
"This image must be located in the `static` directory."
"Countdown used between each video when playing an autoplay playlist.",
"The coutdown is not present if it at 0."
],
"fr": [
"Image par défaut affichée comme poster ou vignette, utilisée pour présenter la playlist.",
"Cette image doit se situer dans le répertoire `static`."
"Compte à rebours utilisé entre chaque vidéo lors de la lecture d'une playlist en lecture automatique.",
"Le compte à rebours n'est pas présent s'il est à 0."
]
},
"pod_version_end": "",
"pod_version_init": "3.4"
},
"COUNTDOWN_PLAYLIST_PLAYER": {
"default_value": 0,
"DEFAULT_PLAYLIST_THUMBNAIL": {
"default_value": "/static/playlist/img/default-playlist.svg",
"description": {
"en": [
"Countdown used between each video when playing an autoplay playlist.",
"The coutdown is not present if it at 0."
"Default image displayed as a poster or thumbnail, used to present the playlist.",
"This image must be located in the `static` directory."
],
"fr": [
"Compte à rebours utilisé entre chaque vidéo lors de la lecture d'une playlist en lecture automatique.",
"Le compte à rebours n'est pas présent s'il est à 0."
"Image par défaut affichée comme poster ou vignette, utilisée pour présenter la playlist.",
"Cette image doit se situer dans le répertoire `static`."
]
},
"pod_version_end": "",
Expand Down Expand Up @@ -2247,6 +2247,36 @@
"pod_version_end": "",
"pod_version_init": "3.1.0"
},
"P2P_TRACKERS": {
"default_value": "[]",
"description": {
"en": [
"",
"Array of trackers for the peer to peer file sharing"
],
"fr": [
"",
"list des trackers pour le partage de fichier en mode pair à pair"
]
},
"pod_version_end": "",
"pod_version_init": "3.4.0"
},
"P2P_STUNS": {
"default_value": "[]",
"description": {
"en": [
"",
"Array of stun server for the peer to peer file sharing"
],
"fr": [
"",
"list des serveurs stun pour le partage de fichier en mode pair à pair"
]
},
"pod_version_end": "",
"pod_version_init": "3.4.0"
},
"RESTRICT_EDIT_VIDEO_ACCESS_TO_STAFF_ONLY": {
"default_value": false,
"description": {
Expand Down Expand Up @@ -2367,6 +2397,21 @@
"pod_version_end": "",
"pod_version_init": "3.1.0"
},
"USE_VIDEO_P2P": {
"default_value": false,
"description": {
"en": [
"",
"active the peer to peer function for video player"
],
"fr": [
"",
"Active la fonction pair à pair dans pod"
ptitloup marked this conversation as resolved.
Show resolved Hide resolved
]
},
"pod_version_end": "",
"pod_version_init": "3.4.0"
},
"USE_XAPI_VIDEO": {
"default_value": false,
"description": {
Expand Down Expand Up @@ -2721,7 +2766,6 @@
"pod_version_end": "",
"pod_version_init": "3.1.0"
},

"VIDEO_REQUIRED_FIELDS": {
"default_value": "[]",
"description": {
Expand Down Expand Up @@ -2835,6 +2879,32 @@
"pod_version_end": "",
"pod_version_init": "3.1.0"
},
"ENCODE_STUDIO": {
"default_value": "start_encode_studio",
"description": {
"en": [
""
],
"fr": [
"Fonction appelée pour lancer l’encodage du studio (merge and cut)."
]
},
"pod_version_end": "",
"pod_version_init": "3.1.0"
},
"ENCODE_VIDEO": {
"default_value": "start_encode",
"description": {
"en": [
""
],
"fr": [
"Fonction appelée pour lancer l’encodage des vidéos direct par thread ou distant par celery"
]
},
"pod_version_end": "",
"pod_version_init": "3.1.0"
},
"ENCODING_CHOICES": {
"default_value": "()",
"description": {
Expand All @@ -2858,6 +2928,21 @@
"pod_version_end": "",
"pod_version_init": "3.1.0"
},
"ENCODING_TRANSCODING_CELERY_BROKER_URL": {
"default_value": false,
"description": {
"en": [
""
],
"fr": [
"",
"Il faut renseigner l'url du redis sur lequel Celery va chercher les ordres d'encodage et de transcription",
"par exemple : \"redis://redis:6379/7\""
]
},
"pod_version_end": "",
"pod_version_init": "3.3.1"
},
"FORMAT_CHOICES": {
"default_value": "()",
"description": {
Expand All @@ -2881,31 +2966,19 @@
"pod_version_end": "",
"pod_version_init": "3.1.0"
},
"ENCODE_STUDIO": {
"default_value": "start_encode_studio",
"description": {
"en": [
""
],
"fr": [
"Fonction appelée pour lancer l’encodage du studio (merge and cut)."
]
},
"pod_version_end": "",
"pod_version_init": "3.1.0"
},
"ENCODE_VIDEO": {
"default_value": "start_encode",
"USE_DISTANT_ENCODING_TRANSCODING": {
"default_value": false,
"description": {
"en": [
""
],
"fr": [
"Fonction appelée pour lancer l’encodage des vidéos direct par thread ou distant par celery"
"",
"Si True, active l'encodage et la transcription sur un environnement distant via redis+celery"
]
},
"pod_version_end": "",
"pod_version_init": "3.1.0"
"pod_version_init": "3.4.0"
},
"VIDEO_RENDITIONS": {
"default_value": "[]",
Expand Down Expand Up @@ -2952,35 +3025,6 @@
},
"pod_version_end": "",
"pod_version_init": "3.1.0"
},
"ENCODING_TRANSCODING_CELERY_BROKER_URL": {
"default_value": false,
"description": {
"en": [
""
],
"fr": [
"",
"Il faut renseigner l'url du redis sur lequel Celery va chercher les ordres d'encodage et de transcription",
"par exemple : \"redis://redis:6379/7\""
]
},
"pod_version_end": "",
"pod_version_init": "3.3.1"
},
"USE_DISTANT_ENCODING_TRANSCODING": {
"default_value": false,
"description": {
"en": [
""
],
"fr": [
"",
"Si True, active l'encodage et la transcription sur un environnement distant via redis+celery"
]
},
"pod_version_end": "",
"pod_version_init": "3.4.0"
}
},
"title": {
Expand Down
Loading