Giter VIP home page Giter VIP logo

Comments (4)

LoeiFy avatar LoeiFy commented on July 3, 2024

你可以在可视化编辑里面 添加媒体,添加音乐,然后插入文章即可

短代码方式添加音乐是可以引用外部音乐,但是插入文章方式不可以

from diaspora.

iexe avatar iexe commented on July 3, 2024

我是想改造下音乐的插入方式,但是这个音乐地址你是在什么地方进行引用的呢?我要在文章的编辑界面添加音乐的上传和URL的输入框!这样就方便了许多

from diaspora.

LoeiFy avatar LoeiFy commented on July 3, 2024

@iexe 我并没有对 wp 插入的音乐做什么处理
https://github.com/LoeiFy/Diaspora/blob/master/assets/Diaspora.js#L174-L198

    player: function(id) {
        var p = $('#audio-'+ id +'-1');

        if (!p.length) {
            $('.icon-play').css({
                'color': '#dedede',
                'cursor': 'not-allowed'
            })
            return
        }

        p[0].play()

        p.on({
            'timeupdate': function() {
                $('.bar').css('width', p[0].currentTime / p[0].duration * 100 +'%')
            },
            'ended': function() {
                $('.icon-pause').removeClass('icon-pause').addClass('icon-play')
            },
            'playing': function() {
                $('.icon-play').removeClass('icon-play').addClass('icon-pause')
            } 
        })
    },

wp 插入的音乐都是有固定格式的,我只是让其播放,读取播放状态

from diaspora.

iexe avatar iexe commented on July 3, 2024

你这么说我就明白了!我的js不是很好 所以没看明白这个方法。谢谢!我准备在页面直接输出这个音乐播放器!这样就方便了 谢谢

from diaspora.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.