mirror of
https://codeberg.org/Hyperpipe/Hyperpipe
synced 2025-06-27 20:58:01 +02:00
Changes:
- Range Headers for videoplayback - Changed behaviour of local playlists - Added UTC timestamps to footer
This commit is contained in:
parent
dac17fbc2d
commit
599e024afa
12 changed files with 465 additions and 416 deletions
|
@ -4,7 +4,8 @@
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta
|
<meta
|
||||||
http-equiv="Content-Security-Policy"
|
http-equiv="Content-Security-Policy"
|
||||||
content="default-src 'self'; img-src *; media-src * blob:; style-src 'unsafe-inline' 'self'; connect-src *" />
|
content="default-src 'self'; base-uri 'none'; form-action 'none'; img-src *; media-src * blob:; style-src 'unsafe-inline' 'self'; connect-src *" />
|
||||||
|
|
||||||
<link rel="icon" href="/favicon.svg" />
|
<link rel="icon" href="/favicon.svg" />
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
||||||
<meta name="msapplication-TileColor" content="#181818" />
|
<meta name="msapplication-TileColor" content="#181818" />
|
||||||
|
@ -16,6 +17,7 @@
|
||||||
|
|
||||||
<link rel="manifest" href="/manifest.json" />
|
<link rel="manifest" href="/manifest.json" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<meta name="referrer" content="no-referrer" />
|
||||||
|
|
||||||
<meta property="og:title" content="Hyperpipe" />
|
<meta property="og:title" content="Hyperpipe" />
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
|
|
788
package-lock.json
generated
788
package-lock.json
generated
File diff suppressed because it is too large
Load diff
14
package.json
14
package.json
|
@ -10,20 +10,20 @@
|
||||||
"check": "prettier --check ."
|
"check": "prettier --check ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bootstrap-icons": "^1.9.1",
|
"bootstrap-icons": "^1.10.2",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"dompurify": "^2.4.0",
|
"dompurify": "^2.4.1",
|
||||||
"mux.js": "^6.2.0",
|
"mux.js": "^6.2.0",
|
||||||
"peerjs": "^1.4.7",
|
"peerjs": "^1.4.7",
|
||||||
"pinia": "^2.0.23",
|
"pinia": "^2.0.26",
|
||||||
"shaka-player": "^4.2.2",
|
"shaka-player": "^4.3.0",
|
||||||
"stream-browserify": "^3.0.0",
|
"stream-browserify": "^3.0.0",
|
||||||
"vue": "^3.2.38",
|
"vue": "^3.2.38",
|
||||||
"xml-js": "^1.6.11"
|
"xml-js": "^1.6.11"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vitejs/plugin-vue": "^3.1.2",
|
"@vitejs/plugin-vue": "^3.2.0",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^2.8.0",
|
||||||
"vite": "^3.1.8"
|
"vite": "^3.2.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
3
src/assets/version.json
Normal file
3
src/assets/version.json
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"date": "2022-11-26"
|
||||||
|
}
|
|
@ -2,8 +2,9 @@
|
||||||
import { ref, watch } from 'vue';
|
import { ref, watch } from 'vue';
|
||||||
|
|
||||||
const props = defineProps(['display', 'title', 'n']),
|
const props = defineProps(['display', 'title', 'n']),
|
||||||
emit = defineEmits(['show']),
|
emit = defineEmits(['show']);
|
||||||
show = ref(props.display);
|
|
||||||
|
const show = ref(props.display);
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.display,
|
() => props.display,
|
||||||
|
@ -13,7 +14,7 @@ watch(
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
watch(show, n => {
|
watch(show, () => {
|
||||||
emit('show', show.value);
|
emit('show', show.value);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -6,19 +6,22 @@ import Modal from './Modal.vue';
|
||||||
|
|
||||||
import { useRand } from '@/scripts/colors.js';
|
import { useRand } from '@/scripts/colors.js';
|
||||||
import { useStore } from '@/scripts/util.js';
|
import { useStore } from '@/scripts/util.js';
|
||||||
import {
|
|
||||||
useAuthCreatePlaylist,
|
|
||||||
getAuthPlaylists,
|
|
||||||
getJsonAuth,
|
|
||||||
} from '@/scripts/fetch.js';
|
|
||||||
import { useI18n } from '@/stores/misc.js';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useListPlaylists,
|
useListPlaylists,
|
||||||
useGetPlaylist,
|
useGetPlaylist,
|
||||||
useCreatePlaylist,
|
useCreatePlaylist,
|
||||||
useUpdatePlaylist,
|
useUpdatePlaylist,
|
||||||
} from '../scripts/db.js';
|
} from '@/scripts/db.js';
|
||||||
|
|
||||||
|
import {
|
||||||
|
useAuthCreatePlaylist,
|
||||||
|
getAuthPlaylists,
|
||||||
|
getJsonAuth,
|
||||||
|
} from '@/scripts/fetch.js';
|
||||||
|
|
||||||
|
import { useResults } from '@/stores/results.js';
|
||||||
|
import { useI18n, useNav } from '@/stores/misc.js';
|
||||||
|
|
||||||
const { t } = useI18n(),
|
const { t } = useI18n(),
|
||||||
store = useStore(),
|
store = useStore(),
|
||||||
|
@ -46,13 +49,18 @@ const emit = defineEmits(['play-urls', 'open-playlist']),
|
||||||
|
|
||||||
const pathname = url => new URL(url).pathname;
|
const pathname = url => new URL(url).pathname;
|
||||||
|
|
||||||
const Play = key => {
|
const Open = key => {
|
||||||
console.log(key);
|
console.log(key);
|
||||||
|
|
||||||
useGetPlaylist(key, res => {
|
useGetPlaylist(key, res => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
if (res.urls.length > 0) {
|
if (res.urls.length > 0) {
|
||||||
emit('play-urls', res.urls);
|
useResults().items.songs = {
|
||||||
|
title: 'Local • ' + key,
|
||||||
|
items: res.urls.map(i => ({ ...i, ...{ thumbnail: '/1x1.png' } })),
|
||||||
|
};
|
||||||
|
|
||||||
|
useNav().state.page = 'home';
|
||||||
} else alert('No songs to play!');
|
} else alert('No songs to play!');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -286,7 +294,7 @@ onMounted(async () => {
|
||||||
:name="i.name"
|
:name="i.name"
|
||||||
:author="t('title.songs') + ' • ' + i.urls.length"
|
:author="t('title.songs') + ' • ' + i.urls.length"
|
||||||
:grad="useRand()"
|
:grad="useRand()"
|
||||||
@open-album="Play(i.name)" />
|
@open-album="Open(i.name)" />
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,22 @@ async function Stream() {
|
||||||
|
|
||||||
const codecs = useStore().getItem('codec');
|
const codecs = useStore().getItem('codec');
|
||||||
|
|
||||||
|
audioPlayer
|
||||||
|
.getNetworkingEngine()
|
||||||
|
.registerRequestFilter((_type, req) => {
|
||||||
|
const headers = req.headers;
|
||||||
|
|
||||||
|
let url = new URL(req.uris[0]);
|
||||||
|
|
||||||
|
if (url.pathname.indexOf('/videoplayback') > -1) {
|
||||||
|
if (headers.Range) {
|
||||||
|
url.searchParams.set('range', headers.Range.split('=')[1]);
|
||||||
|
req.headers = {};
|
||||||
|
req.uris[0] = url.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
audioPlayer.configure({
|
audioPlayer.configure({
|
||||||
preferredAudioCodecs: codecs ? codecs.split(':') : ['opus', 'mp4a'],
|
preferredAudioCodecs: codecs ? codecs.split(':') : ['opus', 'mp4a'],
|
||||||
manifest: {
|
manifest: {
|
||||||
|
|
|
@ -6,10 +6,16 @@ import {
|
||||||
HYPERPIPE_INSTANCE,
|
HYPERPIPE_INSTANCE,
|
||||||
getJson,
|
getJson,
|
||||||
} from '@/scripts/fetch.js';
|
} from '@/scripts/fetch.js';
|
||||||
import { useStore } from '@/scripts/util.js';
|
|
||||||
|
|
||||||
|
import { useStore } from '@/scripts/util.js';
|
||||||
import { SUPPORTED_LOCALES, useI18n } from '@/stores/misc.js';
|
import { SUPPORTED_LOCALES, useI18n } from '@/stores/misc.js';
|
||||||
|
|
||||||
|
const date = ref('unknown');
|
||||||
|
|
||||||
|
import('@/assets/version.json').then(v => {
|
||||||
|
date.value = v.date;
|
||||||
|
});
|
||||||
|
|
||||||
const { t, setupLocale } = useI18n(),
|
const { t, setupLocale } = useI18n(),
|
||||||
instances = ref([]),
|
instances = ref([]),
|
||||||
hypInstances = ref([]),
|
hypInstances = ref([]),
|
||||||
|
@ -286,6 +292,7 @@ onMounted(() => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
|
{{ date }}
|
||||||
<a
|
<a
|
||||||
class="bi bi-code-slash"
|
class="bi bi-code-slash"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|
|
@ -22,8 +22,9 @@ const props = defineProps({
|
||||||
art: String,
|
art: String,
|
||||||
playlistId: String,
|
playlistId: String,
|
||||||
}),
|
}),
|
||||||
emit = defineEmits(['open-song', 'remove']),
|
emit = defineEmits(['open-song', 'remove']);
|
||||||
show = ref(false);
|
|
||||||
|
const show = ref(false);
|
||||||
|
|
||||||
const openSong = el => {
|
const openSong = el => {
|
||||||
if (!el.classList.contains('ign')) {
|
if (!el.classList.contains('ign')) {
|
||||||
|
|
|
@ -25,6 +25,7 @@ export function useDash(streams, len) {
|
||||||
name: 'AdaptationSet',
|
name: 'AdaptationSet',
|
||||||
attributes: {
|
attributes: {
|
||||||
id: i,
|
id: i,
|
||||||
|
contentType: 'audio',
|
||||||
mimeType: mimeTypes[i],
|
mimeType: mimeTypes[i],
|
||||||
startWithSAP: '1',
|
startWithSAP: '1',
|
||||||
subsegmentAlignment: 'true',
|
subsegmentAlignment: 'true',
|
||||||
|
@ -108,6 +109,9 @@ export function useDash(streams, len) {
|
||||||
{
|
{
|
||||||
type: 'element',
|
type: 'element',
|
||||||
name: 'Period',
|
name: 'Period',
|
||||||
|
attributes: {
|
||||||
|
id: 0,
|
||||||
|
},
|
||||||
elements: sets,
|
elements: sets,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -34,7 +34,7 @@ export const SUPPORTED_LOCALES = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
code: 'fa',
|
code: 'fa',
|
||||||
name: 'فارسی'
|
name: 'فارسی',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
code: 'fr',
|
code: 'fr',
|
||||||
|
|
|
@ -68,7 +68,6 @@ export const useResults = defineStore('results', () => {
|
||||||
useNav().state.page = 'home';
|
useNav().state.page = 'home';
|
||||||
|
|
||||||
next.value = hash + '?nextpage=' + encodeURIComponent(json.nextpage);
|
next.value = hash + '?nextpage=' + encodeURIComponent(json.nextpage);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue