{"id":15722392,"url":"https://github.com/defold/extension-videoplayer-native","last_synced_at":"2025-08-11T16:09:10.969Z","repository":{"id":49310053,"uuid":"158553372","full_name":"defold/extension-videoplayer-native","owner":"defold","description":"Videoplayer extension using native views","archived":false,"fork":false,"pushed_at":"2024-08-23T09:30:53.000Z","size":2316,"stargazers_count":9,"open_issues_count":5,"forks_count":9,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-01-30T15:24:54.854Z","etag":null,"topics":["defold","defold-game-engine","defold-library","video-player","videoplayer-extension"],"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.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-21T13:38:16.000Z","updated_at":"2024-10-11T16:12:41.000Z","dependencies_parsed_at":"2022-09-23T10:15:17.176Z","dependency_job_id":null,"html_url":"https://github.com/defold/extension-videoplayer-native","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defold%2Fextension-videoplayer-native","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defold%2Fextension-videoplayer-native/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defold%2Fextension-videoplayer-native/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defold%2Fextension-videoplayer-native/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/defold","download_url":"https://codeload.github.com/defold/extension-videoplayer-native/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237267933,"owners_count":19282309,"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","defold-game-engine","defold-library","video-player","videoplayer-extension"],"created_at":"2024-10-03T22:07:17.885Z","updated_at":"2025-02-05T08:31:04.732Z","avatar_url":"https://github.com/defold.png","language":"C++","funding_links":[],"categories":["Libraries"],"sub_categories":["Programming Language"],"readme":"\n# extension-videoplayer-native\n\nThis is a fullscreen videoplayer extension for **iOS** and **Android** using native OS functionality and components for videoplayback.\n\n# Usage\n\nAdd the package link (https://github.com/defold/extension-videoplayer-native/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# Lua API\n\n## videoplayer.create(uri, settings, callback)\n\nOpens a video from either a uri, and returns a handle to the videoplayer.\n    \n```lua\nfunction videoplayer_callback(self, video, event, data={})\n    ...\nend\n\nself.handle = videoplayer.create(\"/assets/big_buck_bunny_720p_1mb.mp4\", {play_sound = true}, videoplayer_callback)\n```\n\n## videoplayer.destroy(handle)\n\nDestroys the video\n\n\n## videoplayer.set_visible(handle, visible)\n\nShows or hides the video player view\n\n\n## videoplayer.start(handle) / videoplayer.stop(handle) / videoplayer.pause(handle)\n\n\n# Example\n\n*[player.gui_script](main/player.gui_script):*\n    \n```lua\n\nlocal function video_callback(self, video, event, data)\n    if event == videoplayer.VIDEO_EVENT_READY then\n        videoplayer.start(video)\n    elseif event == videoplayer.VIDEO_EVENT_FINISHED then\n        videoplayer.destroy(video)\n        self.handle = nil\n    end\nend\n\nlocal function window_callback(self, event, data)\n    if not self.handle then\n        return\n    end\n\n    if event == window.WINDOW_EVENT_FOCUS_LOST then\n        videoplayer.pause(self.handle)\n    elseif event == window.WINDOW_EVENT_FOCUS_GAINED then\n        videoplayer.start(self.handle)\n    end\nend\n\nfunction init(self)\n    window.set_listener(window_callback)\n    if videoplayer then\n        self.handle = videoplayer.create(\"video.mp4\", {play_sound = true}, video_callback)\n    end\nend\n```\n\n\n# Limitations\n\n## Android\n\nThe android implementation uses the [MediaPlayer](https://developer.android.com/reference/android/media/MediaPlayer) in combination with a [SurfaceView](https://developer.android.com/reference/android/view/SurfaceView) to display the video.\n\nHere's a list of [Supported Video Formats](https://developer.android.com/guide/topics/media/media-formats)\n\n\n# iOS\nTODO\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefold%2Fextension-videoplayer-native","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefold%2Fextension-videoplayer-native","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefold%2Fextension-videoplayer-native/lists"}