vue音乐播放条

先看效果
在这里插入图片描述
再看代码

<template>
  <div class="footer-player z-30 flex items-center p-2">
    <div v-if="isShow" class="h-12 w-60 overflow-hidden">
      <div :style="activeStyle" class="open-detail-control-wrap">
        <div class="flex h-full w-40 items-center">
          <div ref="triggerRef" class="relative" @click="handleArrowClick">
            <n-image
              class="size-12"
              :src="currentSong?.al?.picUrl"
              :preview-disabled="true"
              :style="{filter:isHover ? 'blur(1px)' : 'none'}"
            />
            <transition v-show="isHover" name="fade">
              <div class="flex-items-justify-center absolute left-0 top-0 z-10  size-12 bg-black/60">
                <n-icon :component="KeyboardArrowUpOutlined" size="35" color="white" />
              </div>
            </transition>
          </div>
          <div class="ml-4">
            <p class="flex items-center text-base">
              <n-ellipsis style="max-width: 150px">
                {{ currentSong?.name }}
              </n-ellipsis>
              <heart-icon
                :id="mainStore.currentPlaySong.id" class="ml-2" :like="mainStore.currentPlaySong.like"
                @like-success="likeSuccess"
              /> 
            </p>
            <n-ellipsis>
              <p>{{ formateSongsAuthor(currentSong?.ar || []) }}</p>
            </n-ellipsis>
          </div>
        </div>

        <div class="flex h-12 items-center">
          <n-icon
            size="35" :component="KeyboardArrowDownOutlined" class="ml-4"
            @click="mainStore.setShowMusicDetail(false)"
          />
          <div class="ml-4">
            <div class="circleContainer" @click="handleLikeHeartClick">
              <heart-icon
                :id="mainStore.currentPlaySong.id"
                ref="heardLikeRef" :like="mainStore.currentPlaySong.like"
                :size="25" :trigger-click="true" @like-success="likeSuccess"
              /> 
            </div>
          </div>
          <div class="circleContainer ml-4" @click="subscribeModalRef?.show()">
            <n-icon :component="AddBoxOutlined" :size="20" />
          </div>
        </div>
      </div>
    </div>

    <div :style="{opacity:isShow ? '1' : '0.6'}" class="control flex flex-1 flex-col items-center">
      <div v-if="!isShow" class="footer-player absolute z-50 w-full" />
      <div style="width:300px" class="flex items-center justify-between">
        <n-icon
          class="custom-icon" :size="22" :component="currentPlayModeIcon"
          @click="handlePlayModeClick"
        />
        <n-icon
          class="prev custom-icon" :size="22" :component="SkipPreviousSharp"
          @click="handlePrevClick"
        />
        <div
          class="flex size-8 items-center justify-center rounded-full  bg-neutral-200/60 
        hover:bg-neutral-200 dark:bg-slate-100/20 
        dark:hover:bg-slate-100/40" @click="togglePlayStatus"
        >
          <n-icon :size="mainStore.playing ? 14 : 20" :component="mainStore.playing ? StopIcon :PlayArrowSharp" 
        </div>
        <n-icon
          class="next custom-icon" :size="22" :component="SkipNextSharp"
          @click="handleNextClick"
        />
      </div>
      <div class="mt-1 flex items-center">
        <span v-if="isShow" class="mr-2 text-xs opacity-50">{{ currentPlayTime }}</span>
        <div class="flex flex-1 items-center" :style="{width:progressWidth+'px'}">
          <slider-bar
            v-model="percentage"
            :load-value="progressValue"
            @on-done="handleSliderDone"
            @change="handleSliderChange"
          />
        </div>
        <span v-if="isShow" class="ml-2 text-xs opacity-50">
          <n-time format="mm:ss" :time="currentSong?.dt" />
        </span>
      </div>
    </div>

    <div v-if="isShow" class="flex w-60 items-center justify-end">
      <n-popover
        placement="bottom"
        trigger="hover"
      >
        <template #trigger>
          <n-icon
            :component="volume === 0 ? VolumeOffRound : VolumeUpRound" :size="25" class="custom-icon mr-2"
            @click="handleVolumeClick"
          />
        </template>
        <n-slider
          :value="volume" vertical style="height:100px"
          @update-value="handleVolumeChange"
        />
      </n-popover>
      <n-icon
        :component="List" :size="25" class="custom-icon mr-2"
        @click="playListRef?.show()"
      />
    </div>

    <audio
      ref="audioRef"
      :src="currentSong?.url"
      preload="auto" @timeupdate="handleTimeupdate" @ended="handleEnded"
      @playing="handlePlaying" @progress="updateBuffer" @loadeddata="handleLoadeddata"
      @error="handleError" @waiting="handleWaiting" 
    />

    <play-list ref="playListRef" />
    <music-detail v-if="mainStore.currentPlaySong?.id" ref="musicDetailRef" />
    <subscribe-play-list-modal
      v-if="mainStore.currentPlaySong?.id" ref="subscribeModalRef" 
      :tracks="mainStore.currentPlaySong?.id"
    />
  </div>
</template>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/740167.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Calibre - 翻译电子书(Ebook Translator)

本文参考教程 &#xff1a;https://bookfere.com/post/1057.html 使用 Ebook Translator 插件&#xff0c;详见&#xff1a; 官网&#xff1a;https://translator.bookfere.comgithub &#xff1a;https://github.com/bookfere/Ebook-Translator-Calibre-Plugin 一、基本翻译 …

【已解决】手机进入fastboot无法退出

文章目录 报错及效果图报错代码效果图 解决方案必要的解决方法可能有用的解决方法 报错及效果图 报错代码 手机屏幕显示fastboot&#xff0c;长按电源键无法正常启动 效果图 解决方案 必要的解决方法 1.在电脑上下载并安装adb/fastboot驱动&#xff0c;可以在这里免费下载&…

重学java 83.Java注解

As a failure,I met my last sound. —— 24.6.24 一、注解的介绍 1.引用数据类型: 类、数组、接口、枚举、注解 jdk1.5版本的新特性 一个引用数据类型 和类,接口,枚举是同一个层次的 引用数据类型:类、数组、接口、枚举、注解 2.作用: ① 说明&#xff1a;对代码进行说明,生…

视频格式转换方法:如何使用视频转换器软件转换视频

众所周知&#xff0c;目前存在许多不同的视频和音频格式。但我们的媒体播放器、移动设备、PC 程序等仅兼容少数特定格式。例如&#xff0c;如果不先将其转换为 MP4、MOV 或 M4V 文件&#xff0c;AVI、WMV 或 MKV 文件就无法在 iPhone 上播放。 视频转换器允许您将一种视频格式…

2024年经济与国际贸易国际会议(ICEIT 2024)

2024年经济与国际贸易国际会议&#xff08;ICEIT 2024&#xff09; 2024 International Conference on Economy and International Trade 【重要信息】 大会地点&#xff1a;温州 大会官网&#xff1a;http://www.iciceit.com 投稿邮箱&#xff1a;iciceitsub-conf.com 【注意…

cityscapes数据集转换为COCO数据集格式【速来,我吃过的苦,兄弟们就别再吃了】

利用CityScapes数据集&#xff0c;将其转换为COCO格式的实例分割数据集 – – – 进而再训练出新的YOLOv8-seg模型 写个前言&#xff1a; 人嘛&#xff0c;总想着偷点懒&#xff0c;有现成的数据集&#xff0c;就得拿来用&#xff0c;是吧&#xff1f;确实是这样。 接下来的步…

如何使用mapXplore将SQLMap数据转储到关系型数据库中

关于mapXplore mapXplore是一款功能强大的SQLMap数据转储与管理工具&#xff0c;该工具基于模块化的理念开发&#xff0c;可以帮助广大研究人员将SQLMap数据提取出来&#xff0c;并转储到类似PostgreSQL或SQLite等关系型数据库中。 功能介绍 当前版本的mapXplore支持下列功能…

贪心算法系列(二)|摆动序列最长递增子序列|买卖股票的最佳时机|买卖股票的最佳时机II

摆动序列 分析 最经典的做法还是使用两个dp表的动态规划(代码放下面)这里采用贪心算法&#xff0c;直接上结论整个序列中&#xff0c;波峰波谷起点和重点的个数就是整个最长的摆动序列长度 那么如何判断波峰/波谷呢&#xff1f;也很简单left nums[i] - nums[i-1]right nu…

JBPM4 JBDL Demo

JBPM4 JBDL Demo 工作流样例&#xff0c;工作流程定义文件

面向对象六大设计原则--依赖倒置

目录 六大原则 定义 概念 Java语言中的表现 优点 在设计模式中体现 工厂方法模式 观察者模式 状态模式 示例 手机模块设计 五个示例 一、读取数据 二、发送消息 三、支付方式 四、日志记录 五、数据持久化 使用汽车驾驶进行说明 依赖的三种写法 1.构造函数…

基于FPGA的温湿度检测

初始化部分就不过多赘述&#xff0c;我会给出对应的文件&#xff0c;我只说明这部分里面涉及到使用的代码部分 1、数据的读取和校验 数据的读取和检验代码如下 always (posedge clk_us)if (data_temp[7:0] data_temp[39:32] data_temp[31:24] data_temp[23:16] data_te…

SQLite3的使用

14_SQLite3 SQLite3是一个嵌入式数据库系统&#xff0c;它的数据库就是一个文件。SQLite3不需要一个单独的服务器进程或操作系统&#xff0c;不需要配置&#xff0c;这意味着不需要安装或管理&#xff0c;所有的维护都来自于SQLite3软件本身。 安装步骤 在Linux上安装SQLite…

AI数据分析:集中度分析和离散度分析

在deepseek中输入提示词&#xff1a; 你是一个Python编程专家&#xff0c;要完成一个Python脚本编写的任务&#xff0c;具体步骤如下&#xff1a; 读取Excel表格&#xff1a;"F:\AI自媒体内容\AI行业数据分析\toolify月榜\toolify2023年-2024年月排行榜汇总数据.xlsx&qu…

【PADS】软件下载安装、PADS—Altium Designer文件转换

PADS软件学习——软件下载、安装、解析 一、软件下载 PADS&#xff1a;链接&#xff1a;https://pan.baidu.com/s/1J9z-Rl9sLjfnZYwlE3ZLPQ?pwdGLNG 提取码&#xff1a;GLNG解析软件&#xff1a;http://mentor.mr-wu.cn/PADS教学视频&#xff1a;https://www.bilibili.com/v…

“硝烟下的量子”:以色列为何坚持让量子计算中心落地?

自2023年10月7日新一轮巴以冲突爆发以来&#xff0c;支持巴勒斯坦伊斯兰抵抗运动&#xff08;哈马斯&#xff09;的黎巴嫩真主党不时自黎巴嫩南部向以色列北部发动袭击&#xff0c;以军则用空袭和炮击黎南部目标进行报复&#xff0c;双方在以黎边境的冲突持续至今。 冲突走向扑…

Django教程(001):安装及快速上手

1.1 Django安装 pip install django安装之后 c:\python39-python.exe-Scripts-pip.exe-django-admin.exe【安装django之后&#xff0c;工具&#xff0c;创建django项目】-Lib-内置模块-site-packages-flask-django(安装django之后&#xff0c;【django框架源码】)如下图&…

springboot 网上商城系统-计算机毕业设计源码08789

摘 要 随着互联网趋势的到来&#xff0c;各行各业都在考虑利用互联网将自己推广出去&#xff0c;最好方式就是建立自己的互联网系统&#xff0c;并对其进行维护和管理。在现实运用中&#xff0c;应用软件的工作规则和开发步骤&#xff0c;采用Java技术建设网上商城系统。 本设…

HTTPS 代理的优点和缺点是什么?

HTTPS&#xff08;超文本安全传输协议&#xff09;作为一种基于HTTP加上SSL安全层的网络通信协议&#xff0c;已经成为互联网上广泛使用的IP协议之一。它在保证信息安全和隐私方面具有很多优势&#xff0c;但也存在一些缺点。接下来&#xff0c;我们就来探究一下HTTPS协议的优缺…

导致代理IP延迟高的原因

很多用户在使用代理IP进行网络访问时&#xff0c;可能会遇到代理IP超时的情况&#xff0c;也就是代理IP的延迟过高。代理IP延迟过高会影响用户的网络体验和数据获取效率。因此&#xff0c;了解代理IP延迟过高的原因很重要。以下是导致代理IP延迟过高的一些常见原因&#xff1a;…

相位和展开相位

相位 (Phase) 相位是一个周期信号在一个周期内的位置&#xff0c;通常以角度&#xff08;度或弧度&#xff09;表示。在许多应用中&#xff0c;相位被限制在一个周期内。例如&#xff0c;相位通常被限定在 −180∘到 180∘ 或 0∘ 到 360∘ 之间。 示例 −90∘ 表示信号在周…