{"id":18052885,"url":"https://github.com/minooo/media-app-api","last_synced_at":"2026-01-19T21:33:26.330Z","repository":{"id":87399167,"uuid":"130145952","full_name":"minooo/media-app-api","owner":"minooo","description":"新媒体接口调用方式，仿微信","archived":false,"fork":false,"pushed_at":"2018-05-09T07:20:29.000Z","size":59,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T07:43:53.409Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/minooo.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-19T02:08:43.000Z","updated_at":"2018-11-18T11:40:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"aca43b18-bbe4-4fd7-a4f2-c6785d81bb0f","html_url":"https://github.com/minooo/media-app-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/minooo/media-app-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minooo%2Fmedia-app-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minooo%2Fmedia-app-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minooo%2Fmedia-app-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minooo%2Fmedia-app-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minooo","download_url":"https://codeload.github.com/minooo/media-app-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minooo%2Fmedia-app-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28585515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T20:45:59.482Z","status":"ssl_error","status_checked_at":"2026-01-19T20:45:41.500Z","response_time":67,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-10-30T23:13:27.684Z","updated_at":"2026-01-19T21:33:26.314Z","avatar_url":"https://github.com/minooo.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# media-app-api\n新媒体接口调用方式，仿微信\n\n```js\n// 切换导航显示与否\nwx.switchNav(JSON.stringify({\n show: 1  // 1 显示  0 隐藏\n}))\n\n// 是否开启顶部状态栏透明\nwx.onTopTransparent(JSON.stringify({\n  enable: \"yes\"  // yes no  \n}))\n\n// 返回课程列表\nwx.courseListTo()\n\n// 返回插件列表\nwx.pluginListTo()\n\n// 登陆\nwx.navigateTo(JSON.stringify({\n  path: \"/login\", // 必选\n  back: `${window.location.origin}/sight-audio/${data.id}` // 登陆成功后需要继续跳转的页面，如果没有，则默认跳到首页\n}))\n\n// 课程\nwx.courseTo(JSON.stringify({\n  path: `${window.location.origin}/course/${item.id}`, // 必选\n  mediaType: `${item.chapter_type === 1 ? item.chapter_media_type : 3}`, // 1音频， 2视频 3图文，如果是图文，原生应该自动隐去视频/音频模块,\n  mediaUrl: `${item.chapter_type === 1 ? item.chapter_media_url : \"\"}`, // 免费的多媒体的url \n  img: item.image\n}))\n\n// 视角\nwx.sightTo(JSON.stringify({\n  path: `${window.location.origin}/sight-audio/${item.id}`, // 必选\n}))\n\n// 设置\nwx.setTo(JSON.stringify({\n  path: \"\", // 必选\n}))\n\n// 无返回参数的登陆\nwx.loginTo(JSON.stringify({\n  path: \"\", // 必选\n}))\n\n// 分享\nwx.onShare(JSON.stringify({\n  title: data.title, // 分享标题\n  desc: data.introduce, // 分享描述\n  link: window.location.href, // 分享链接\n  imgUrl: \"http://public.duduapp.net/new-media/app/static/avatar.png\", // 分享图标\n}))\n\n// 下载\nwx.downloadFile(JSON.stringify({\n  url: data.audio_url // 下载资源的 url，下载成功后原生那边最好给个页面提示,\n  title: data.title, // 标题\n  created: data.chapters[focus].created_at, // 创建日期\n  img: (data.author \u0026\u0026 data.author.avatar) || \"http://public.duduapp.net/new-media/app/static/avatar.png\", // 占位图\n  id: data.id\n}))\n\n// 提供页面需要的音频等字段\nwx.audioSourse(JSON.stringify({\n  url: data.audio_url, // 音频链接\n  text: data.audio_text, // 音频文字\n  img: (data.author \u0026\u0026 data.author.avatar) || \"http://public.duduapp.net/new-media/app/static/avatar.png\",\n  title: data.chapters[focus].title,\n  mediaType: \"1\", // 1音频， 2视频 3图文，如果是图文，原生应该自动隐去视频/音频模块\n  prev: `${window.location.origin}/sight-audio/${data.prev \u0026\u0026 data.prev.id}`, // 上一个音频的页面链接，注意这不是音频链接\n  next: `${window.location.origin}/sight-audio/${data.next \u0026\u0026 data.next.id}`, // 下一个音频的页面链接，注意这不是音频链接\n}))\n\n// 初始化提供页面需要的音频等字段\nwx.audioInitSourse(JSON.stringify({\n   url: data.chapters[focus].media_url,\n   img: data.chapters[focus].image,\n   title: data.chapters[focus].title,\n   chapterId: chapters[focus].id,\n   text: data.chapters[focus].media_url === 1 \u0026\u0026 data.chapters[focus].content,\n   mediaType: `${data.chapters[focus].chapter_type === 1 ? data.chapters[focus].media_type : 3}`,\n }))\n \n // 给出课程的一点信息\n wx.giveCourseTip(JSON.stringify({\n  price: data.price,\n  is_buy: response.is_buy\n}))\n \n // 移除页面的多媒体播放模块\n wx.removeMedia()\n \n // 支付\n wx.pay(JSON.stringify({\n    return_code: \"SUCCESS\",\n    return_msg: \"OK\",\n    appid: \"wx01754ee3c11b2f17\",\n    mch_id: \"1483129732\",\n    nonce_str: \"dBfGibahLFadbVlr\",\n    sign: \"66A9E13BADBB5C86222FF673A518C9B8\",\n    result_code: \"SUCCESS\",\n    prepay_id: \"wx271056069612794e07eed3fb4126190544\",\n    trade_type: \"APP\"\n }))\n \n // 音频数组列表\n wx.giveAudioArr(JSON.stringify({\n   audios: response.chapters\n }))\n // \"id\": 1,\n // \"media_url\": \"http://public.duduapp.net/new-media/app/static/go.mp3\",\n // \"image\": \"http://file.duduapp.net/40/dd/40dd2634742268b8b94e1e4bacba1301.png\",\n // \"title\": \"Harmony Heaney\"\n \n// 跳转推送信息界面\nwx.msgPush(JSON.stringify({\n  path: \"/msg\"\n}))\n\n// 跳转下载课程页面\nwx.downloadCourse(JSON.stringify({\n  path: \"/downloadcourse\"\n}))\n\n// 上传图片\nwx.imgTo(JSON.stringify({\n type: opType, token: token\n}));\n\n// 第三方注册成功\nwx.succeedTo(JSON.stringify({\n member_id: id\n}));\n\n//调起电话\nwx.callPhone(\n JSON.stringify({\n   tel: \"13526832296\"\n })\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminooo%2Fmedia-app-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminooo%2Fmedia-app-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminooo%2Fmedia-app-api/lists"}