{"id":15722442,"url":"https://github.com/defold/extension-videoplayer","last_synced_at":"2025-10-20T04:31:56.629Z","repository":{"id":18075522,"uuid":"83283959","full_name":"defold/extension-videoplayer","owner":"defold","description":"Videoplayer for the Defold engine","archived":false,"fork":false,"pushed_at":"2024-11-02T09:11:33.000Z","size":39489,"stargazers_count":9,"open_issues_count":3,"forks_count":6,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-01-30T15:25:09.404Z","etag":null,"topics":["defold"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/defold.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-27T07:59:30.000Z","updated_at":"2024-11-02T09:11:37.000Z","dependencies_parsed_at":"2022-08-07T09:00:30.278Z","dependency_job_id":null,"html_url":"https://github.com/defold/extension-videoplayer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defold%2Fextension-videoplayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defold%2Fextension-videoplayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defold%2Fextension-videoplayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defold%2Fextension-videoplayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/defold","download_url":"https://codeload.github.com/defold/extension-videoplayer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237267970,"owners_count":19282320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["defold"],"created_at":"2024-10-03T22:07:41.509Z","updated_at":"2025-10-20T04:31:56.623Z","avatar_url":"https://github.com/defold.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Disclaimer\n\nThis is an example extension, with no sound support. Although we aim to provide good example functionality in this example, we cannot guarantee the quality/stability at all times.\nPlease regard it as just that, an example, and don't rely on this as a dependency for your production code.\n\nAlternative videoplayers:\n\n* Native videoplayer (Android/iOS) - [extension-videoplayer-native](https://github.com/defold/extension-videoplayer-native)\n* MPEG1 videoplayer - [extension-videoplayer-mpeg](https://github.com/defold/extension-videoplayer-mpeg)\n\n\n# extension-videoplayer\n\nExample of creating a videoplayer (.webm) through native extensions.\n\n\n# How to build the libraries\n\n[Instructions here](videoplayer/utils/README.md)\n\n\n# FAQ\n\n## How do I use this extension?\n\nAdd the package link (https://github.com/defold/extension-videoplayer/archive/master.zip)\nto the project setting `project.dependencies`, and you should be good to go.\n\nSee the [manual](http://www.defold.com/manuals/libraries/) for further info.\n\n\n# Lua API\n\n## videoplayer.open(videoresource)\n\nOpens a video resource, and returns a handle to the instance.\n\n    local videoresource = resource.load(\"/videos/big_buck_bunny.webm\")\n    self.video = videoplayer.open(videoresource)\n\n## videoplayer.get_info(video)\n\nGets the info about the video:\n\n* width - in pixels\n* height - in pixels\n* bytes_per_pixel\n* frame - current frame\n* time - current time in seconds\n* eos - true if end of stream was reached\n\n## videoplayer.get_frame(video)\n\nGets the video buffer. This is allocated when opening the video.\nThe buffer has one stream, with signature `{hash(\"rgb\"), buffer.VALUE_TYPE_UINT8, 3}`.\n\n    self.videoframe = videoplayer.get_frame(self.video)\n\n## videoplayer.update(video, dt)\n\nUpdates the video with a delta time\n\n\n# Example\n\n*[main.script](main/main.script):*\n\n    function init(self)\n        local logosize = 128\n        local screen_width = sys.get_config(\"display.width\", 600)\n        local screen_height = sys.get_config(\"display.height\", 800)\n        local scale_width = screen_width / logosize\n        local scale_height = screen_height / logosize\n\n        go.set(\"#sprite\", \"scale\", vmath.vector3(scale_width, scale_height, 1) )\n\n        if videoplayer ~= nil then\n            local videoresource = resource.load(\"/videos/big_buck_bunny.webm\")\n            self.video = videoplayer.open(videoresource)\n            self.videoinfo = videoplayer.get_info(self.video)\n            self.videoheader = { width=self.videoinfo.width, height=self.videoinfo.height, type=resource.TEXTURE_TYPE_2D, format=resource.TEXTURE_FORMAT_RGB, num_mip_maps=1 }\n            self.videoframe = videoplayer.get_frame(self.video)\n        else\n            print(\"Could not initialize videoplayer\")\n        end\n    end\n\n    function update(self, dt)\n        if videoplayer ~= nil then\n            videoplayer.update(self.video, dt)\n            local path = go.get(\"#sprite\", \"texture0\")\n            resource.set_texture(path, self.videoheader, self.videoframe)\n        end\n    end\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefold%2Fextension-videoplayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefold%2Fextension-videoplayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefold%2Fextension-videoplayer/lists"}