Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL API #7

Open
crescendoCat opened this issue Oct 16, 2018 · 3 comments
Open

MySQL API #7

crescendoCat opened this issue Oct 16, 2018 · 3 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects

Comments

@crescendoCat
Copy link
Owner

由於第三次作業需要從後端讀取資料送至前端
因此一個用來查找資料庫的API必不可少(也是作業規定啦)

我想,建立一個php撰寫的MySQL API應該會方便許多,不論是php版或ajax版都可以使用這個API。

@crescendoCat crescendoCat added enhancement New feature or request help wanted Extra attention is needed labels Oct 16, 2018
@crescendoCat crescendoCat self-assigned this Oct 16, 2018
@crescendoCat crescendoCat added this to To do in HW3 via automation Oct 16, 2018
@crescendoCat
Copy link
Owner Author

crescendoCat commented Oct 16, 2018

要提供的API有:

  1. 提供影片字幕

    • 輸入:
      影片編號 video_id
    • 輸出:
      JSON格式字幕資料,包含
      • 開始時間 starting time
      • 持續時間 duration
      • 字幕內容 content
    • 說明:
      提供撥放頁使用
  2. 提供最新影片資訊

    • 輸入:
      • 頁碼 page_number or page_num
      • 每頁影片數 video_number or video_num
    • 輸出:
      JSON格式影片資料,必須輸出 每頁影片數 數量的影片(應該是用json array的表示方式啦...),每部影片包含
      • 影片編號 video_id
      • 影片縮圖連結 thumbnail_link
      • 影片標題 title
      • 影片說明 content

如果還有想到的可以再加~ 沒有意外的話這應該就是我們作業三使用的文件與應遵守的格式。
有個統一格式大家也比較好撰寫程式~

@crescendoCat crescendoCat added this to the 作業三Basic milestone Oct 16, 2018
@crescendoCat crescendoCat moved this from To do to In progress in HW3 Oct 19, 2018
@crescendoCat crescendoCat moved this from In progress to Reviewer approved in HW3 Oct 27, 2018
@crescendoCat crescendoCat moved this from Reviewer approved to Done in HW3 Oct 27, 2018
@crescendoCat crescendoCat moved this from Done to Needs review in HW3 Oct 27, 2018
@crescendoCat crescendoCat removed this from the 作業三Basic milestone Oct 31, 2018
@crescendoCat
Copy link
Owner Author

網址輸入頁面

判斷是否有影片列表,如果有的話,取得

  1. 各個影片的ID ( video )
  2. 影片列表的ID ( list )
  3. 目前所在影片的編號 ( index )

注意
將上述 1. 存為json字串利用 session 存在server上,並以 list 作為 session key
將上述 2, 3. 利用 url query 帶到影片頁,例如:

使用者輸入https://www.youtube.com/watch?v=CPkYrekCXwo&index=6&list=PLfPilU3rNFygiLaKYAgUPCSwGxaP5cUKv
我們要產生一個連結,連結url是
https://awp-hw-page:8888/a/path/to/new/video/page?video=CPkYrekCXwo&index=6&list=PLfPilU3rNFygiLaKYAgUPCSwGxaP5cUKv

此處 index 代表這是這個列表的 第六部影片 我覺得影片編號還是沿用youtube的用法,從 1 開始編號
接著順便 利用API 取得所有影片的字幕並放入Database
(嗯 如果在處理字幕的時候可以利用 WebSocket 作進度條應該滿酷的)

接著必須將

  1. 影片縮圖
  2. 影片Title
  3. 影片長度
  4. 其他你想到可以放上去的影片資料
    呈現在網頁上

server取得影片列表資料

拿到資料後必須

  1. 產生video頁面
  2. 產生一個包含有縮圖以及連結的影片列表(透過傳入的 url 以及 session )

@crescendoCat
Copy link
Owner Author

@ya94030110 如果你實作上有困難需要幫助會希望 @ShellyHsueh 先想想辦法,不然 video 頁面的內容好像有點少?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
HW3
  
Needs review
Development

No branches or pull requests

1 participant