Giter VIP home page Giter VIP logo

Comments (3)

numberwolf avatar numberwolf commented on May 27, 2024

请参考README的事件,onLoadFinsh onReadyShowDone 之后play

而且你这么playerObj.player.play() 这么调用做法就是错误的。 为什么要自己去操作里面的player对象,API是让你直接在playerObj操作的。

from h265web.js.

sunkingsss avatar sunkingsss commented on May 27, 2024

大佬您好,我按您说的改了之后确实没有报错了,但是为什么视频文件播放不出来,一直都是黑屏
`const PLAYER_CORE_TYPE_DEFAULT = 0; // 默认播放器内核
const PLAYER_CORE_TYPE_CNATIVE = 1; // 实验播放器内核

    const token =
        "base64:QXV0aG9yOmNoYW5neWFubG9uZ3xudW1iZXJ3b2xmLEdpdGh1YjpodHRwczovL2dpdGh1Yi5jb20vbnVtYmVyd29sZixFbWFpbDpwb3JzY2hlZ3QyM0Bmb3htYWlsLmNvbSxRUTo1MzEzNjU4NzIsSG9tZVBhZ2U6aHR0cDovL3h2aWRlby52aWRlbyxEaXNjb3JkOm51bWJlcndvbGYjODY5NCx3ZWNoYXI6bnVtYmVyd29sZjExLEJlaWppbmcsV29ya0luOkJhaWR1";

    var config = {
        player: "glplayer",
        width: 960,
        height: 540,
        type: "raw265",
        token: token,
        extInfo: {
            moovStartFlag: true
        }
    };

    // const url = "test13.h265"
    const url = "hevc_test_moov_set_head_16s.mp4"
    let player = window.new265webjs(url, config);

    player.onLoadFinish = function () {
        console.log("load finish");
        player.play()
    }

    player.onReadyShowDone = function(e) {
        console.log("ready done");
    }

    player.do()`

from h265web.js.

numberwolf avatar numberwolf commented on May 27, 2024

onReadyShowDone 后面调用Play()
还有 浏览器里面不要自行 调用play函数,一定要进行交互式调用,就是必须用户点击才可以。不然浏览器安全限制会不让你播放。

改掉这个没用的坏习惯吧。

from h265web.js.

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.