question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to destory dplayer on live mode?

See original GitHub issue

As you know. Dplayer add a new API on 1e21471 dp.destroy()

I try use this API on beforeDestroy call dp.destroy() ,also use v-if destory this DOM instance, but Network Panel(Chrome DevTools) still making requests continuously.

What should i do…

Config : video: { url: 'http://example.com/live.m3u8', type: 'hls' } Google Chrome | 75.0.3770.100 (64 bit) (cohort: Stable) Windows 10, Vue ^2.5.10

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
kn007commented, Aug 18, 2019

@axetroy 你编译了么? 我提交了commit,但是只是源码改了,并没有输出编译好的文件。 编译办法你可以参照文档。 你也可以先下载上面的test501.zip先用着。

0reactions
qingwufongcommented, Aug 26, 2022

1.29 发现也有这个问题:播放器销毁后,hls实例并没有销毁,一直刷ts。注意player销毁的时候hls实例也要销毁。 截图 底层hls播放相关的,都要小心这个问题,容易引发内存泄漏,需要代码手动销毁。 示例:

  1. 创建播放器时,存下hls实例:
        this.hls = new Hls();
        const hls = this.hls;
        this.player = new DPlayer({
          container: playDom,
          video: {
            url: videoSource,
            type: "customHls",
            customType: {
              customHls: function (video, player) {
                hls.loadSource(video.src);
                hls.attachMedia(video);
              },
            },
          },
          hotkey: true,
          autoplay: true,
          live: true,
        });
  1. 在某个时机,比如页面组件销毁前手动销毁hls和播放器:
    if (this.hls) {
      // 先销毁hls实例!不然会内存泄漏
      this.hls.stopLoad()
      this.hls.destroy()
      this.hls = null
    }
    this.player.destroy();
Read more comments on GitHub >

github_iconTop Results From Across the Web

Safely Destroy Actors When Out Of Range and Not On Screen
... I am going to create a system to destroy the NPC characters who are far away from the player more than a...
Read more >
How to destroy and respawn the player after loosing a life?
why destroy the player? just move it back to the start position. if you want to make an explosion or something, just move...
Read more >
Any advice on how to play co-op in Research and Destroy?
You would need to conquer 3 territories in Single player in order to unlock the multiplayer/co-op option! Can either do co-op on same...
Read more >
Should I destroy players/characters on removing? Concerned ...
I'm wondering - could I not just avoid this by destroying the instances when they leave? Destroy automatically disconnects connections so as ...
Read more >
Player SDK: Reference - Vimeo Developer
Here are the methods for player details: Destroy a player; Get the color of a player; Get the embed code of a video;...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found