Recherche avancée

Médias (91)

Autres articles (72)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (13717)

  • ffmpeg pipe response how to play javascript ?

    30 mars 2017, par 최진영

    Hello i have some question

    i trying app.post and response angular2

    here is my code

    function.js

    var url = 'https://www.youtube.com/watch?v=' + id;
    try {
          youtubeStream(url).pipe(res)
        } catch (exception) {
           res.status(500).send(exception)
         }

    response.ts

          this.loading = true
           var headers = new Headers();
           var query = {
                        "videoURL" : this.tracklist[0].videoURL
                       }
            headers.append('Content-Type', 'application/json');
            this.http.post('http://localhost:4100/toMp3',query,{headers: headers}).subscribe((res) => {
                console.log(res) <-- plz check picture
            });

    console.log(res)

    console.log(res)

    I do not know how to play stream data in _body

  • Discord.js v14 : AudioPlayer isn't working

    6 septembre 2023, par colonelPanic

    I'm new to javascript in general, and I'm making a Discord bot that can join a voice channel and play some audio. When I run the slash command that I set up, I get no errors and a reply that suggests that everything is running correctly, but no audio is playing. I've looked at the documentation for the audio player and some examples of how to do this on youtube, but I can't find any hints as to why there's no audio.

    


    The command that I'm using to handle the audio player is shown below :

    


    // These are the contents of the 'play.js' file where I'm defining and exporting the slash command 

const { SlashCommandBuilder } = require('discord.js');
const { createAudioPlayer, 
        NoSubscriberBehavior, 
        AudioPlayerStatus,
        getVoiceConnection,
        createAudioResource,
        joinVoiceChannel
      } = require('@discordjs/voice');

module.exports = {
    data: new SlashCommandBuilder()
        .setName('play')
        .setDescription('Plays a song/sound in the voice channel you are in.')
        .addStringOption((option) => 
            option
            .setName('sound')
            .setDescription('The sound/song to play.')
            .setRequired(true)
            .addChoices(
                {name: 'spiderman-pizza', value: 'https://www.youtube.com/watch?v=czTksCF6X8Y'},
                {name: 'royaltyfree-1',   value: 'C:/resources/sounds/royaltyfree-1.mp3'}
            )
        ),
    async execute(interaction) {
        // Create the audio player
        const audioPlayer = createAudioPlayer({
            behaviors: {
                noSubscriber: NoSubscriberBehavior.Pause,
            },
        });
        // Get the existing voice connection
        var connection = getVoiceConnection(interaction.guild.id);
        // If there is no existing connection, create one
        if (!connection) {
            connection = joinVoiceChannel({
                channelId: interaction.member.voice.channel.id,
                guildId: interaction.guild.id,
                adapterCreator: interaction.guild.voiceAdapterCreator
            });
        }
        // Get the chosen audio resource and play it in the voice channel
        const resource = createAudioResource(interaction.options.getString('sound'));
        audioPlayer.play(resource);
        connection.subscribe(audioPlayer);

        interaction.reply({content: `Playing ${interaction.options.getString('sound')}`, ephemeral: true});
    }
}


    


    I don't get any errors when I execute this command with either of the available choices, but the audio player doesn't play anything. On the Discord server, I've given the bot all permissions except for Administrator, and the intents that I've specified in the code can be seen below :

    


    const { 
    Client, 
    Collection, 
    Events, 
    GatewayIntentBits,
 } = require('discord.js');

// Create a new client instance
const client = new Client({ 
    intents: [
            GatewayIntentBits.Guilds,
            GatewayIntentBits.MessageContent,
            GatewayIntentBits.GuildMessages,
            GatewayIntentBits.GuildMembers,
            GatewayIntentBits.GuildVoiceStates
            ] 
        }
    );


    


    I know that the '/play' command is registered and that the bot can join the user's voice channel when '/play' is executed. I've installed 'libsodium-wrappers' (encryption package), 'ffmpeg-static', and '@discordjs/voice' using npm so I don't think there should be any dependency issues. Does anyone have an idea of why the audio isn't playing ?

    


  • ffmpeg doesn't see yt_dlp stream

    24 décembre 2022, par matiz22

    I making discord bot and i am trying to move from youtube_dl to yt_dlp to get +18 videos from youtube, I am getting error Output file #0 does not contain any stream.

    


    self.YTDL_OPTIONS = {'format': 'bestaudio', 'nonplaylist': 'True', 'youtube_include_dash_manifest': False}

self.FFMPEG_OPTIONS = {
    'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5',
    'options': '-vn'
}


    


    with YoutubeDL(self.YTDL_OPTIONS) as ydl:
    try:
        info = ydl.extract_info(url, download=False)
    except:
        return False
return {
    'link': 'https://www.youtube.com/watch?v=' + url,
    'thumbnail': 'https://i.ytimg.com/vi/' + url + '/hqdefault.jpg?sqp=-oaymwEcCOADEI4CSFXyq4qpAw4IARUAAIhCGAFwAcABBg==&rs=AOn4CLD5uL4xKN-IUfez6KIW_j5y70mlig',
    'source': info['formats'][0]['url'],
    'title': info['title']
}


    


    self.vc[id].play(discord.FFmpegPCMAudio(
    song['source'], **self.FFMPEG_OPTIONS), after=lambda e: self.play_next(interaction))


    


    This config works with youtube_dl, but not with yt_dlp. Any ideas what i should change ?