OpenStr.com 帮助程序员托管视频教程

本文介绍了一种名为OpenStr的开源框架,专为开发者设计,解决视频教程发布、版权保护及成本问题。它支持离线加密播放,降低流量费用,配合CLI工具实现无缝教学体验。

openstr.com 是我采用 openmix.org 开源框架 MixPHP MixGo 开发的一套创新的 DRM 系统,旨在帮助开发者低成本发布视频教程,获取必要的收益。另外:这两个框架也是我开发的

想要发布视频教程遇到的问题

开源创造者或编程大神想分享一些技术时:

  • 发布到 bilibili 等公开平台则颗粒无收,用爱发电无法持续坚持
  • 慕课网只能按他们出的选题来讲课,很难匹配,同时抽佣感人
  • 自己部署网站,开发需要时间,同时 OSS 对象存储的流量费用及其高昂
  • 支付渠道很难申请
  • 传统视频网站对教程视频中关联的代码和说明信息无法展示,影响学习体验

离线加密视频网页播放技术

我开发了一个多平台 win mac linux 的 CLI 程序,来负责离线加密视频的驱动

  • 首先我们只需使用 openstr-cli make foo.mp4 命令把我们的 .mp4 视频转换为 .str 加密视频文件
  • 然后使用 openstr-cli emit foo.str 将加密视频发布到网站里
  • 接下来在网站中创建一个频道,将视频发布到这个频道中,例如:PHP 与 Go 的基础知识对比视频讲解
  • 在视频下方提供了和 Github、Gitee 同样的 Readme 页,开发者可以编写视频中涉及的代码和演讲内容,用户可以边看视频边复制代码测试
  • 然后在视频页面点击分享按钮,将视频信息贴到你的开源项目 Readme 页中,例如:github.com/mix-go/mix
  • 在网页里我们可以添加 .str 的下载地址,当然也可以选择直接通过 QQ 等直接发给你的用户
  • 持有 .str 文件的用户,只需打开 openstr-cli 就可以直接到网页中播放这个视频(付费后)
  • 由于是本地播放,没有流量费用产生,同时视频想多高清就多高清,快进快退也迅速
  • 同时 .str 是加密文件,无需担心视频的泄露问题,随便放哪里都可以
解释一下列ts语句的语法,纯文本输出.<!-- sy1\src\layout\components\Sidebar\index.vue --> <template> <div> <div class="logo"> <!-- <img src="./../../../assets/logo.png" width="122.5" alt="" > --> <!-- <img src="@/assets/login/login-logo.png" alt="" style="width: 120px; height: 31px" /> --> <div v-if="!isCollapse" class="sidebar-logo" > <img src="@/assets/login/logo.png" style="width: 120px; height: 31px" > </div> <div v-else class="sidebar-logo-mini" > <img src="@/assets/login/mini-logo.png"> </div> </div> <el-scrollbar wrap-class="scrollbar-wrapper"> <el-menu :default-openeds="defOpen" :default-active="defAct" :collapse="isCollapse" :background-color="variables.menuBg" :text-color="variables.menuText" :active-text-color="variables.menuActiveText" :unique-opened="false" :collapse-transition="false" mode="vertical" > <sidebar-item v-for="route in routes" :key="route.path" :item="route" :base-path="route.path" :is-collapse="isCollapse" /> <!-- <div class="sub-menu"> <div class="avatarName"> {{ name }} </div> <div class="img"> <img src="./../../../assets/icons/btn_close@2x.png" class="outLogin" alt="退出" @click="logout" /> </div> </div> --> </el-menu> </el-scrollbar> </div> </template> <script lang="ts"> import { Component, Prop, Vue } from 'vue-property-decorator' import { AppModule } from '@/store/modules/app' import { UserModule } from '@/store/modules/user' import SidebarItem from './SidebarItem.vue' import variables from '@/styles/_variables.scss' import { getSidebarStatus, setSidebarStatus } from '@/utils/cookies' import Cookies from 'js-cookie' @Component({ name: 'SideBar', components: { SidebarItem } }) export default class extends Vue { private restKey: number = 0 get name() { return (UserModule.userInfo as any).name ? (UserModule.userInfo as any).name : JSON.parse(Cookies.get('user_info') as any).name } get defOpen() { // const urlArr = this.$route.path.split('/') // const openStr = urlArr.length > 2 ? `/${urlArr[1]}` : '/' let path = ['/'] this.routes.forEach((n: any, i: number) => { if (n.meta.roles && n.meta.roles[0] === this.roles[0]) { path.splice(0, 1, n.path) } }) return path } get defAct() { let path = this.$route.path return path } get sidebar() { return AppModule.sidebar } get roles() { return UserModule.roles } get routes() { let routes = JSON.parse( JSON.stringify([...(this.$router as any).options.routes]) ) console.log('-=-=routes=-=-=', routes) console.log('-=-=routes=-=-=', this.roles[0]) let menuList = [] let menu = routes.find(item => item.path === '/') if (menu) { menuList = menu.children } console.log('-=-=routes=-wwww=-=', routes) return menuList } get variables() { return variables } get isCollapse() { return !this.sidebar.opened } private async logout() { this.$store.dispatch('LogOut').then(() => { // location.href = '/' this.$router.replace({ path: '/login' }) }) // this.$router.push(`/login?redirect=${this.$route.fullPath}`) } } </script> <style lang="scss" scoped> .logo { text-align: center; background-color: #ffc100; padding: 15px 0 0; height: 60px; img { display: inline-block; } } .sidebar-logo-mini { img { width: 30px; height: 30px; } } .el-scrollbar { height: 100%; background-color: rgb(52, 55, 68); } .el-menu { border: none; height: calc(95vh - 23px); width: 100% !important; padding: 47px 15px 0; } </style>
10-23
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值