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

start parameter is not working #54

Open
mobileteamtechaffinity opened this issue Dec 2, 2020 · 1 comment
Open

start parameter is not working #54

mobileteamtechaffinity opened this issue Dec 2, 2020 · 1 comment

Comments

@mobileteamtechaffinity
Copy link

mobileteamtechaffinity commented Dec 2, 2020

I have done a sample project with the below parameters and it's working correctly. After a month I tried the same parameters is not working and the video still starts from 0

let parameters: [String: Any] = [
"fullscreen-action": "trigger_event",
"logo": "false",
"sharing-action": "trigger_event",
"start": Int(25)
]
let controller = DMPlayerViewController(parameters: parameters)
controller.delegate = self
return controller
}()

@RemiGuyon
Copy link
Contributor

The start parameter should not be passed during the player init but when the video is loaded:

func loadVideo(_ videoId: String) {
  let parameters = [“start”: 30]
  guard
    let encoded = try? JSONEncoder().encode(parameters),
    let params = String(data: encoded, encoding: .utf8)
  else { return }

  playerViewController.load(videoId: videoId, params: params)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants